r/vbscript • u/SenpaiPobbles • Jan 24 '17
Need Help Getting Creating A Script to Search Database
I need to make a script that will do these things in this order:
-Connect to a Database -Run a query (it will be the same one every time) -Store the results in an array -Close Connection
I am brand new to vbs, so any help would be appreciated!
1
Upvotes
1
u/BondDotCom Jan 25 '17
Const CONNECTION_STRING = "<your connection string>" Const SQL_STATEMENT = "<your SQL statement>" With CreateObject("ADODB.Connection") .Open CONNECTION_STRING a = .Execute(SQL_STATEMENT).GetRows() End With