A Wml question
-
Hi all, Please help In my first card I ask for 3 user inputs. Where you want to start and end your journey and a time you want to travel after, in the format 12:25Enter Start Station Enter Destination Station Enter Time _The problem________________________________________________ In my second card I want to connect to a database in MicroSoft Access and use these variables in an Sql statement. I don't know the correct syntax for connecting to the database or for using the variables in my Sql statement. The Sql statement is incomplete, I just want to know how to use variables within it, setting them equal to something and saying something > $variable ________________________________ <% Dim SqlJunk 'Create a connection odject Set dbGlobalWeb = Server.CreateObject("ADODB.Connection") 'Database connection info and driver rsGlobalWeb = "DRIVER={Microsoft Access Driver (*.mdb)};uid=; DBQ=" & Server.MapPath("\.....\database.mdb") 'Set an active connection to the Connection object dbGlobalWeb.Open rsGlobalWeb SqlJunk = "SELECT Start.StationName AS Start, Start.Time AS JourneyTime, Destination.StationName AS End FROM Station AS Start, Station AS End, Time AS JourneyTime WHERE Start.StationName LIKE '%" & $Start & "%' AND Destination.Station LIKE '%" & $End & "%' AND Start.Time > #" & $Statement & "#" Set rsGlobalWeb = Server.CreateObject("ADODB.Recordset") rsGlobalWeb.Open SqlJunk, dbGlobalWeb, 3 'Now I must display the results <%=rsGlobalWeb("Start")%> <%=rsGlobalWeb("JourneyTime")%> <%=rsGlobalWeb("End")%> %> Damien