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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection.Execute Method Error

Status
Not open for further replies.

vza

Programmer
Aug 1, 2003
179
US
I am trying to execute a SQL statement from VBScript. The statement works in Oracle (SQL*Plus) but creates a Oracle Error within my HTML/ASP page

Error: ORA-00900 Invalid SQL statement.

If this same statement works within Oracle, why not within an ADO connection Execute statement?? I don't think it has anything to do with the ADO connection itself for it is used numerous other places in code, with no errors. Here is my VBscript statement:


Code:
Cn.Execute "COPY FROM userID/password@DSN TO userID/password@DSN REPLACE Dest_Table Using Select * From Source_Table"


Can .Execute be used for any SQL statement?? (besides UPDATE, INSERT, DELETE, CREAT/DROP TABLE...etc) Any responses will be greatly appreciated.

Thanks
-vza
 
It can execute any valid sql statement. Do you need quotes in your code at all(I'm not familiar with oracle)? Are userID/password@DSN values you use when you connect to the DB?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
I use the actual username/password/DSN in my actual statement.

Thanks
-vza
 
what I'm asking is are the username/password combos the same one that you use when you create the connection? Are they the same ones you use when you connect directly to oracle to make changes? If you take the EXACT string that you are executing and remove the quotes from the beginning and end, it works in oracle?



Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
yes it does. which is why i don't understand why it is not working. its the exact same line minus the "Cn.execute" part.

Thanks
-vza
 
have you tried asking in the oracle forum (I'm guessing that there is an oracle forum....)

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook (No, I'm not Rick)

fart.gif
 
thanks for the tip...i will check it out....

thanks
-vza
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top