Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stored procedure parameter
Message
From
31/07/1999 22:37:37
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Stored procedure parameter
Miscellaneous
Thread ID:
00248636
Message ID:
00248636
Views:
44
I'm on a project that deal with SQL 7. I'm using ADO/ODBC and have no problem. But, I was asking myself if ther was any way of skiping a parameter when calling a stored procedure ? Here an exemple of my code

Dim cmd As New ADODB.Command
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "sp_InsertClient"
cmd.Parameters.Refresh
cmd.Parameters(1) = iClientID
cmd.Parameters(2) = sUserName
cmd.Parameters(3) = sPassword
cmd.Execute

And I want to call the same procedure but with only 2 parameters like this

Dim cmd As New ADODB.Command
cmd.CommandType = adCmdStoredProc
cmd.CommandText = "sp_InsertClient"
cmd.Parameters.Refresh
cmd.Parameters(1) = iClientID
cmd.Parameters(2) = sPassword
cmd.Execute

Also, I handle my error(s) with a Resume Next when a parameter in NULL. But I don't feel comfortable with this way (Like if sPassword is NULL or empty and there is no Resume Next, I will get an ODBC error).


Thanks in advance
Next
Reply
Map
View

Click here to load this message in the networking platform