Jump to content

{A_K_A}

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by {A_K_A}

  1. Yes it is now working! Here is the code if any one is intrested

    Set rstSimple = cnnSimple.Execute("SELECT * FROM People, Address, Contact_NO where people.ID = Address.ID and people.ID = Contact_NO.ID")
    I have one more question. I have created a html form to add records to the access DB and have moved the asp code in to a new file called diplay.asp. one, is this a good idea and two how can I call the file from the html page so the table is displayed?
  2. Hi all,

    <% Dim cnnSimple ' ADO connection Dim rstSimple ' ADO recordset Set cnnSimple = Server.CreateObject("ADODB.Connection") ' DSNLess cnnSimple.Open ("Provider= Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("\DB.accdb")) Set rstSimple = cnnSimple.Execute("SELECT * FROM People") 'Set rstSimple1 = cnnSimple.Execute("SELECT * FROM Address")%> <P> Connecting to Access with Ole connection </P><table border="1"> <% Do While Not rstSimple.EOF %> <tr> <td><%= rstSimple.Fields(0).Value %></td> <td><%= rstSimple.Fields(1).Value %></td> <td><%= rstSimple.Fields(2).Value %></td> </tr> <% rstSimple.MoveNext Loop %></table> <% rstSimple.Close Set rstSimple = Nothing cnnSimple.Close Set cnnSimple = Nothing%>
    Sorry tried to attach but the upload failed. Anyway I have the above code to connect to my Access database. Now my database has 3 tables: People, Address and Contact. Currently the only way I know to display all three tables is to have 3 vars, loops etc. I was wandering if there was a better way to display all 3 Access tables? PS, all 3 tables have an ID field which I only want to display once (ID is primary key in people and a foreign key in the other two). Any help would be much appreciated :)
×
×
  • Create New...