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!

vbscript begin trans execute cmd

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]

 
Kate,
I think you would get a better reply to this if you posted it in the VB forum.

- Paul
10qkyfp.gif

- If at first you don't succeed, find out if the loser gets anything.
 
thanks, I'll give it a try.

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