This is probably a pretty simple question, but I can't seem to find the answer to it anywhere on the web. When using an OLEDB connection to SQL
strconn= "Provider=SQLOLEDB;Server=SQL;Database=SomeDB;User Id=XXX;Password=XXXXX;"
cSql.Open strconn
the connection returns errors when I pass it a SQL query using the Access syntax for a date parameter like this:
sql="SELECT tblSchedule.*
sql=sql+" FROM tblSchedule
sql=sql+" WHERE (((tblSchedule.Date)=#"+sDate+"#));
If I use a linked table and pass it the same query via the currentproject.connection connection, it works fine, but SQL server errors out on it. Can anyone tell me the correct SQL syntax for this type of connection to pass a date to a SQL table?
Thanks
Kirk
strconn= "Provider=SQLOLEDB;Server=SQL;Database=SomeDB;User Id=XXX;Password=XXXXX;"
cSql.Open strconn
the connection returns errors when I pass it a SQL query using the Access syntax for a date parameter like this:
sql="SELECT tblSchedule.*
sql=sql+" FROM tblSchedule
sql=sql+" WHERE (((tblSchedule.Date)=#"+sDate+"#));
If I use a linked table and pass it the same query via the currentproject.connection connection, it works fine, but SQL server errors out on it. Can anyone tell me the correct SQL syntax for this type of connection to pass a date to a SQL table?
Thanks
Kirk