R
rick
I'm getting an error message when trying to run the following code to create
a temporary querydef from a stored procedure called "IDX_TimeData" on our Sql
Server:
'build a querydef for the passthrough sp w parameters using DAO
Set db = CurrentDb
strSQL = "EXEC IDX_TimeData " & "'" & txtFromDate & "', " & "'" &
txtToDate & "', " & param1 & ", " & param2 & ", " & param3 & ", " & param4
Set qdfPassthrough = db.CreateQueryDef("", strSQL)
With qdfPassthrough
.Connect = "Provider=ODBC;DSN=Finance"
.ODBCTimeout = 0
.ReturnsRecords = True
.Close
End With
Set qdfPassthrough = Nothing
At the CreateQueryDef statement, I get an error number 3139: Invalid SQL
statement, expected DELETE, INSERT, UPDATE, SELECT or PROCEDURE.
Apparently something is wrong with my SQL string.
Help greatly appreciated.
Rick
a temporary querydef from a stored procedure called "IDX_TimeData" on our Sql
Server:
'build a querydef for the passthrough sp w parameters using DAO
Set db = CurrentDb
strSQL = "EXEC IDX_TimeData " & "'" & txtFromDate & "', " & "'" &
txtToDate & "', " & param1 & ", " & param2 & ", " & param3 & ", " & param4
Set qdfPassthrough = db.CreateQueryDef("", strSQL)
With qdfPassthrough
.Connect = "Provider=ODBC;DSN=Finance"
.ODBCTimeout = 0
.ReturnsRecords = True
.Close
End With
Set qdfPassthrough = Nothing
At the CreateQueryDef statement, I get an error number 3139: Invalid SQL
statement, expected DELETE, INSERT, UPDATE, SELECT or PROCEDURE.
Apparently something is wrong with my SQL string.
Help greatly appreciated.
Rick