Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing Oracle Stored Procedure...

Status
Not open for further replies.

GDX

Programmer
Jun 4, 2000
186
US
Hello Guys I have a problem im am trying to execute the following oracle SP but im getting the error:

"Snytax Error Or Access Violation"

When i run the same line in Worksheet it executes it sucesfully..any ideas?

Dim oCommand As New ADODB.Command
oCommand.ActiveConnection = "Driver={Microsoft ODBC for Oracle};Server=myserver;Uid=u;Pwd=pw;"
Linerun = "execute INVENTORY_POST('Xiacon','R','CTL006','003','02-44-845','HL-25-06Z1.35%','+','240','EA','VISHAY','','','','01092002','1','240','BOX');"
oCommand.CommandText = Linerun
oCommand.CommandType = adCmdStoredProc
oCommand.Execute , , adOptionUnspecified

Thanks a lot! Gordon R. Durgha
gd@vslink.net
 
1) If you've recently changed user u's permissions on any table the SP accesses, try recompiling the SP.

2) Try using the Oracle OLEDB provider ISO the ODBC driver.

3) What do you mean by in worksheet? Excel? Jon Hawkins
 
If you want to execute the SPROC using a command object, the use is different than what you have specified.

To execute it like that, just execute lineRun directly on your connection object. For example:
Code:
dim con, strCon, Linerun
set con = server.createObject("ADODB.Connection")
strCon = "Driver={Microsoft ODBC for Oracle};Server=myserver;Uid=u;Pwd=pw;"
Linerun = "execute INVENTORY_POST('Xiacon','R','CTL006','003','02-44-845','HL-25-06Z1.35%','+','240','EA','VISHAY','','','','01092002','1','240','BOX');"

con.open strCon
con.execute LineRun
con.close

set con = nothing

hope that helps! :)
paul
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top