May 24th, 2000, 03:06 PM
Hi,
I'm trying to execute a stored procedure using DAO 3.6, but it is failing to execute.
I've used connect method to connect to the database and then created a querydef. Using the parameters property of the querydef, I've set all the parameters and direction, but when it comes to the execute method, it just fails with the error 3146.
The code looks like:
cTrackerSP = "{ call CST_ACM_CONV.GET_DATA (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }"
Set qdfTracker = dbTracker.CreateQueryDef("", cTrackerSP)
With qdfTracker
.Parameters(0).Direction = dbParamInputOutput
For i = 1 To 19
.Parameters(i).Direction = dbParamInput
Next
.Parameters(1) = "123"
.Parameters(2) = "Particulier"
.Parameters(3) = "0626082650"
.Parameters(4) = "Smith"
.Parameters(5) = ""
.Parameters(6) = "John"
.Parameters(7) = "0202002181"
.Parameters(8) = ""
.Parameters(9) = "Street Name 13"
.Parameters(10) = ""
.Parameters(11) = "City"
.Parameters(12) = "CA"
.Parameters(13) = "27718"
.Parameters(14) = "US"
.Parameters(15) = ""
.Parameters(16) = ""
.Parameters(17) = ""
.Parameters(18) = ""
.Parameters(19) = ""
.Execute
If .Parameters(0).Value <> 0 Then
'Success!
'Do something here
End If
End With
In the above code, when I use the word call to describe the stored procedure name, it fails, but goes further down when the word call is removed.
Can anyone suggest a robust method to call a stored procedure using parameters?
Regard,
Subrahmanyam
[Edited by Subrahmanyam Vadali on 05-25-2000 at 04:08 AM]
I'm trying to execute a stored procedure using DAO 3.6, but it is failing to execute.
I've used connect method to connect to the database and then created a querydef. Using the parameters property of the querydef, I've set all the parameters and direction, but when it comes to the execute method, it just fails with the error 3146.
The code looks like:
cTrackerSP = "{ call CST_ACM_CONV.GET_DATA (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }"
Set qdfTracker = dbTracker.CreateQueryDef("", cTrackerSP)
With qdfTracker
.Parameters(0).Direction = dbParamInputOutput
For i = 1 To 19
.Parameters(i).Direction = dbParamInput
Next
.Parameters(1) = "123"
.Parameters(2) = "Particulier"
.Parameters(3) = "0626082650"
.Parameters(4) = "Smith"
.Parameters(5) = ""
.Parameters(6) = "John"
.Parameters(7) = "0202002181"
.Parameters(8) = ""
.Parameters(9) = "Street Name 13"
.Parameters(10) = ""
.Parameters(11) = "City"
.Parameters(12) = "CA"
.Parameters(13) = "27718"
.Parameters(14) = "US"
.Parameters(15) = ""
.Parameters(16) = ""
.Parameters(17) = ""
.Parameters(18) = ""
.Parameters(19) = ""
.Execute
If .Parameters(0).Value <> 0 Then
'Success!
'Do something here
End If
End With
In the above code, when I use the word call to describe the stored procedure name, it fails, but goes further down when the word call is removed.
Can anyone suggest a robust method to call a stored procedure using parameters?
Regard,
Subrahmanyam
[Edited by Subrahmanyam Vadali on 05-25-2000 at 04:08 AM]