% Dim objDC, objRS ' Create and establish data connection Set objDC = Server.CreateObject("ADODB.Connection") objDC.ConnectionTimeout = 15 objDC.CommandTimeout = 30 'Use this line to use Access 'objDC.Open "DBQ=" & Server.MapPath("CHART.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20;", "username", "password" 'Our SQL Server code - use above line to use sample on your server objDC.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("CHART.MDB") & ";" ' Create recordset and retrieve values using the open connection Set objRS = Server.CreateObject("ADODB.Recordset") ' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1) ' If a request for a specific id comes in, then do it o/w just show pulldown If Len(Request("train")) <> 0 Then ' request record for requested id objRS.Open "SELECT * FROM text1 WHERE train = '" & Request("train")&"'" , objDC ' Show selected record If Not objRS.EOF Then objRS.MoveFirst %>
train | train no | eta |
<%= objRS.Fields("train") %> | <%= objRS.Fields("tno") %> | <%= objRS.Fields("eta") %> |