hello guys,
I am running into problems with this ADO control I am using:
With adoEditTimes
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & mdbPATH
.RecordSource = "times"
.Refresh
End With
the above runs just fine. but if I want the recordsource to be some SQL statement, like:
rsSQL = "SELECT * FROM times"
rsSQL = rsSQL & " WHERE [Student Number] = " & CLng(txtAddID.Text)
rsSQL = rsSQL & " ORDER BY Switch([Day]= 'Monday',1,[Day]='Tuesday',2,[Day]='Wednesday',3,[Day]='Thursday',4,[Day]='Friday',5,[Day]='Saturday',6,[Day]='Sunday',7)"
and then set the recordsource of the DAO to that, I get an error "Syntax error in FROM clause".
What in hell causes this to happen, cuz i had this same sql statement bound to a DAO control, and it ran fine.
please help,
vlada
I am running into problems with this ADO control I am using:
With adoEditTimes
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & mdbPATH
.RecordSource = "times"
.Refresh
End With
the above runs just fine. but if I want the recordsource to be some SQL statement, like:
rsSQL = "SELECT * FROM times"
rsSQL = rsSQL & " WHERE [Student Number] = " & CLng(txtAddID.Text)
rsSQL = rsSQL & " ORDER BY Switch([Day]= 'Monday',1,[Day]='Tuesday',2,[Day]='Wednesday',3,[Day]='Thursday',4,[Day]='Friday',5,[Day]='Saturday',6,[Day]='Sunday',7)"
and then set the recordsource of the DAO to that, I get an error "Syntax error in FROM clause".
What in hell causes this to happen, cuz i had this same sql statement bound to a DAO control, and it ran fine.
please help,
vlada