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!

ado begin trans w/ string query

Status
Not open for further replies.

techkate

Programmer
Feb 23, 2004
118
US
I'm relatively new to vbscript. What's harder is that it's been a while since using ADO. I'm a little rusty, and I'm having trouble finding what I'm looking for on Google. As always, I post here in those situations.

Basically, I'm looking to use a SQL Transaction and execute a string update query which is passed in to this routine.

In the code below, the variable named theSQL is an update query that has been tested and works correctly.

What are the problems in this syntax/logic?
Code:
Dim adoConn
Set adoConn = CreateObject("ADODB.Connection")
adoConn.Open application("DSN")
Dim adoCmd
Set adoCmd = CreateObject("ADODB.Command")
Set adoCmd.ActiveConnection = adoConn
    
adoConn.BeginTrans
adoCmd.CommandText = theSQL;
adoCmd.Execute
adoConn.CommitTrans

Thanks.

Kate

[small]"The Distorted View"
-the only podcast that's fresh perked
www.distortedview.com[/small]

 
Any error message ?
What is application in the following ?
adoConn.Open application("DSN")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
one word:

semicolon!

what can I say, I'm a javascript junkie.

Thanks.

Kate

[small]"The Distorted View"
-the only podcast that's fresh perked
www.distortedview.com[/small]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top