I
Ivan Grozney
I have a stored procedure on my SQL 2000 Server that I would like to call. I
am using Doug Steele's DSN less connection for the database. The Stored
Procedure has two paramaters to pass in.
The SP calulates the number of points someone has earned by month. I would
like to not have to duplicate the code in access if possible
I have tried ADO (as best I could figure it out) and DAO. No matter what I
seem to get errors saying that I cannot do a SELECT Query. So I tried to
create a pass through query (I cannot figure out how to create a DSNless
connection in the pass through so I could use help with that too).
If I use this code
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String
strSQL = "exec usp_pointTotals " & Me.txtYear & ", " & Me.txtLifeStepID
Set dbCurr = CurrentDb
Set qdfCurr = dbCurr.QueryDefs("ZeePassThrough")
qdfCurr.SQL = strSQL
DoCmd.RunSQL ("zeepassthrough")
qdfCurr.ReturnsRecords = True
' CurrentDb.Execute "zeepassthrough", dbFailOnError
' qdfCurr.Execute dbFailOnError
nothing works
CurrentDB.Execute gives me the 3065 cannot run a Select query
DoCmd.RunSQL gives me the 3129 needs to be insert, procedure, ...
qdfCurr.Execute gives me the 3065 cannot run a Select query
TIA
Vanya
am using Doug Steele's DSN less connection for the database. The Stored
Procedure has two paramaters to pass in.
The SP calulates the number of points someone has earned by month. I would
like to not have to duplicate the code in access if possible
I have tried ADO (as best I could figure it out) and DAO. No matter what I
seem to get errors saying that I cannot do a SELECT Query. So I tried to
create a pass through query (I cannot figure out how to create a DSNless
connection in the pass through so I could use help with that too).
If I use this code
Dim dbCurr As DAO.Database
Dim qdfCurr As DAO.QueryDef
Dim strSQL As String
strSQL = "exec usp_pointTotals " & Me.txtYear & ", " & Me.txtLifeStepID
Set dbCurr = CurrentDb
Set qdfCurr = dbCurr.QueryDefs("ZeePassThrough")
qdfCurr.SQL = strSQL
DoCmd.RunSQL ("zeepassthrough")
qdfCurr.ReturnsRecords = True
' CurrentDb.Execute "zeepassthrough", dbFailOnError
' qdfCurr.Execute dbFailOnError
nothing works
CurrentDB.Execute gives me the 3065 cannot run a Select query
DoCmd.RunSQL gives me the 3129 needs to be insert, procedure, ...
qdfCurr.Execute gives me the 3065 cannot run a Select query
TIA
Vanya