agent0047
Programmer
- Jan 11, 2008
- 15
Thanks in advance, I am new to VBS and sp's so I am not really sure how to make this happen but here goes. I need a set of records that are grouped by 'Pending' to be updated every night via VBS, but I am not sure how to connect to the SQL Database with vbs. Any direction would be great?
set rs = Server.CreateObject ("ADODB.Recordset")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=SQLNCLI;Server=SERVER\SQLEXPRESS;Database=Data;Trusted_Connection=yes;"
Conn.Open
sql = "SELECT * FROM [Data] WHERE [Data].[Status]="Pending"' " <--this should be grouped by 'Pending' so it chages all the pending records
rs.open sql, conn
'--
rs.Status="Processed"
rs.Update
rs.close
Conn.Close
set rs = Server.CreateObject ("ADODB.Recordset")
Set conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=SQLNCLI;Server=SERVER\SQLEXPRESS;Database=Data;Trusted_Connection=yes;"
Conn.Open
sql = "SELECT * FROM [Data] WHERE [Data].[Status]="Pending"' " <--this should be grouped by 'Pending' so it chages all the pending records
rs.open sql, conn
'--
rs.Status="Processed"
rs.Update
rs.close
Conn.Close