Thank's PHV. But I decide to use something to output like csv:
But thank's any way.
Set Rs1 =CreateObject( "ADODB.Recordset" )
Rs1.Open Source, Connect, adOpenForwardOnly
Do while not Rs1.EOF
WScript.Echo Rs1(0) & "," & Rs1(1)
Rs1.movenext
Loop
Help me to finish this code, please.
Dim Source
Dim Connect
Dim Rs1,intString
Source = "SELECT * FROM UnidadeOrganica"
Connect = "Provider=sqloledb;Data Source=SQL2PMACL02;" & _
"Initial Catalog=GrupoBanifMCS;Integrated Security=SSPI;"
Set Rs1 =CreateObject( "ADODB.Recordset" )...
Hi, PHV
That's my problem, when I use "count(*)" and this code, I only get one line.
cmd.Prepared = True
Set rs = cmd.Execute
sunumber = rs(0)
wscript.echo sunumber
cn.Close
But I need to insert the code to get all rows information to a file. That must be something like using a loop.
Hi,
I need to do a vbscript or a VB that connect to a database, execute a sql statement and send the output to a file. I have the done something so far, but I can't finish it. Can someone help me?
Dim cmd
Dim rs
Dim params
Dim param
Dim ArgObj, sunumber
Set ArgObj = WScript.Arguments
set...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.