| || |
VBScript SQL Server Query
I am currently trying to connected to MS SQL Server 2008 using VBScript and run 2 queries to get output tables in .xls or .csv. [img]/images/graemlins/confused.gif[/img]
I'm not sure how to do it, but this is what I have so far.
myConnection = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.RecordSet")
myConnection.Open "Provider=blah; Server=blahblah; Uid=blahblahblah;Pwd=blahblahblahblah"
SQL_QUERY1 = "SELECT * FROM blahblahblah..."
SQL_QUERY2 = "SELECT blahblah..."
QUERY1 = myConnection.Execute(SQL_QUERY1)
QUERY2 = myConnection.Execute(SQL_QUERY2)
QUERY_OUTPUT = "C:\Entitlements.csv"
I know it's probably wrong so please give me some insight.