January 19th, 2004, 12:12 PM
query syntax error
hi i have to query the database nut keep getting a syntax in my query error, however the query works fine when trying in microsoft access. the query is
databaseCommand = "4"
Dim db As New ADODB.Connection
Dim rec As New ADODB.Recordset
Dim query As String
db.ConnectionString = "Data Source=hover;"
Dim parameter As String
query = "SELECT Passengers,Cars From RouteSchedule WHERE ((CInt(RouteSchedule.RouteNos)='" & CInt(Parser(1)) & "' AND WHERE (CStr(RouteSchedule.Day)='" & CStr(Parser(2)) & "' AND WHERE (((RouteSchedule.DepTime)='" & CStr(Parser(3)) & "')));"
rec.Open query, db
WS.SendData databaseCommand & "," & rec.Fields(CStr("Passengers")).Value & (",") & rec.Fields(CStr("Cars")).Value
the result states that there is an error in the syntax but is not specific any help is welcome.
January 19th, 2004, 04:08 PM
do yourself a favour, do not cross-post the same question into multiple forums, you will only annoy people that way, and reduce the chances of getting an answer
this Access question has been answered in the MySQL forum