Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ADO - how do I work with 2 tables from same database?

1 view
Skip to first unread message

anthony

unread,
Sep 5, 2001, 2:52:15 AM9/5/01
to
I would like to be able to access *2* tables from the same database.
I'm fairly new to ASP and ADO.
Here's the ASP:

Thank You!


<%@ Language=VBScript %>
<%

'Create object. In this case Connection to a database
Set Conn = Server.CreateObject("ADODB.Connection")

'Select provider
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"

'Select data source.
Conn.ConnectionString = "Data
Source=\\premfs2\sites\premium7\dhomes\database\visitors.mdb"

'Open the connection
Conn.Open

'Create recordset
Set Rs = Server.CreateObject("ADODB.Recordset")

'Open recordset with the connection which we have created earlier
Rs.Open "SELECT * from visitors;", Conn, 1,3
'this is where the second table would go. I don't fully understand the
Conn, 1,3 in the above

%><TABLE BORDER=1><%

'Loop thru records
do while not rs.EOF%>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("DATE")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("TIME")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("IP")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("REFERER")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("DOMAIN")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("URL")%></FONT></TD>
<TD ALIGN=LEFT NOWRAP=1><FONT SIZE=-1><%Response.Write
rs("BROWSER")%></FONT></TD><TR>
<%
rs.MoveNext ' Movenext
loop
%></TABLE><%

'Deinitialize the Connection and Recordset
set Rs = nothing
set Conn = nothing
%>

0 new messages