intelwizrd
IS-IT--Management
I am trying to write a script that perform some basic file operations based on the status of another system. I need to do a select from a table on a sql database and if any results, then i perform some action, if not, i perform another action. i am not very familiar with db interaction with vb. i can try and post some of what i have but forgive me if it doesnt make much sense.
Dim conn
Dim strSQLInProgress
set conn = CreateObject ("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source=xxx.xxx.xxx.xxx; Initial Catalog=dbdatabase;Network=DBMSSOCN;Uid=test;pwd=testing;"
strSQLInProgress = "SELECT COUNT(id) " _
& " FROM tblData " _
& " WHERE var1 = 1 AND var2 = 1 AND var3 = 0"
conn.Execute StrSQLInProgress, NumRunning
wscript.echo "number in progress: " & NumRunning
the value of "NumRunning" is -1. when i check the table in the database, it is 4. what did i do wrong?
----------------------------
Josh
CCNA, MCSE 2003(in progress)
Dim conn
Dim strSQLInProgress
set conn = CreateObject ("ADODB.Connection")
conn.Open "Provider=SQLOLEDB; Data Source=xxx.xxx.xxx.xxx; Initial Catalog=dbdatabase;Network=DBMSSOCN;Uid=test;pwd=testing;"
strSQLInProgress = "SELECT COUNT(id) " _
& " FROM tblData " _
& " WHERE var1 = 1 AND var2 = 1 AND var3 = 0"
conn.Execute StrSQLInProgress, NumRunning
wscript.echo "number in progress: " & NumRunning
the value of "NumRunning" is -1. when i check the table in the database, it is 4. what did i do wrong?
----------------------------
Josh
CCNA, MCSE 2003(in progress)