Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-11-11 : 08:04:54
|
| Arun writes "Hi there,I want to know how i can run script file from VB, just like the way we do in Query analyzer.thanxArun" |
|
|
tuenty
Constraint Violating Yak Guru
278 Posts |
Posted - 2004-11-11 : 09:48:54
|
you have to set an adodb.connection open it and then execute the statementdim conn as new adodb.connectiondim sqlStatement as stringsqlstatement= "Update tblWhatever Set field1 = 1 Where field2 =3; Update tblX set field1 = 0 " _ & "where fieldX=1"conn.open connStr 'this a global variable containing the connection stringconn.execute sqlstatementconn.closeset conn= nothing but if you want to use the output of the sql statements then you must also use a recordsetfor more info search on the MSDN for ADO connections, recordsets and connection strings*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*A candle loses nothing by lighting another candle |
 |
|
|
|
|
|