Executing a Stored Procedure with visual basic 6 [message #288171] |
Sat, 15 December 2007 05:48 |
grupoapunte
Messages: 5 Registered: September 2007
|
Junior Member |
|
|
Hey, im developing an aplication that uses stored procedures from an oracle DB, i found a sample code to do this, but i think its a bit long if i have to do the same thing for every procedure, the question is if its posible to use the execute command with the procedure and the params all in one line, for example:
Set rsFiltro1 = cnOracleDb.Execute("PROCEDURE NAME AND PARAMS GOES HERE")
This is the sample code that i found:
Conn.Open "PROVIDER=OraOLEDB.Oracle;DATA SOURCE=xxxxx;” & _
“USER ID=xxxxxx;PASSWORD=xxxxxx;PLSQLRSet=1"
Cmd.ActiveConnection = Conn
Cmd.CommandType = adCmdStoredProc
Cmd.CommandText = "AL_PACKAGE.AL_PROCEDURE1"
Cmd.Parameters.Append Cmd.CreateParameter("SiteID", adVarChar, adParamInput, 10, TxtQuery.Text)
Cmd.Parameters.Append Cmd.CreateParameter("ErrCode", adVarChar, adParamOutput, 10)
Set RS = Cmd.Execute
Thanks
|
|
|
|
Re: Executing a Stored Procedure with visual basic 6 [message #288177 is a reply to message #288171] |
Sat, 15 December 2007 07:44 |
grupoapunte
Messages: 5 Registered: September 2007
|
Junior Member |
|
|
hehehe yeah i know, but it is long because i have over 100 diferent stored procedures and copy paste wont work in this case becasue the procedures have diferent quatities of parameters. Anyway i just want to know if its posible to use execute("") so i just have to write the procedure name and params
|
|
|