It Seems I've solved my previous doubt about the ADODB
case. I've used this code to launch the query:
SQLString = "SELECT COD_NOTARIO FROM dbo.tblNOTARIO"
Dim oCn, oFSO
Set oCn = CreateObject("ADODB.Connection")
Set oFSO = CreateObject("Scripting.FileSystemObject")
oCn.Open
"PROVIDER=SQLOLEDB.1;SERVER=.;UID=sa;PWD=;DATABASE=FinalMultiple;"
oCn.Execute SQLString
Set oCn = Nothing
However I've run into a much more amusing issue given that
I can't figure out how to access to the query results from
the ActiveX script (a column and many fields).
Could anybody be so kind to tell me how can I see from VBS
the query results?
TIA
Greetings,
David Grant> Could anybody be so kind to tell me how can I see from VBS
> the query results?
You need a recordset object. Code snippet:
Set oRs = oCn.Execute(SQLString)
Do While oRs.EOF = False
'process each row here
cod = oRs.Fields("COD").Value
oRs.MoveNext
Loop
Hope this helps.
Dan Guzman
SQL Server MVP
"David Grant" <anonymous@.discussions.microsoft.com> wrote in message
news:80c501c528bc$b4592170$a601280a@.phx.gbl...
> It Seems I've solved my previous doubt about the ADODB
> case. I've used this code to launch the query:
>
> SQLString = "SELECT COD_NOTARIO FROM dbo.tblNOTARIO"
>
> Dim oCn, oFSO
> Set oCn = CreateObject("ADODB.Connection")
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> oCn.Open
> "PROVIDER=SQLOLEDB.1;SERVER=.;UID=sa;PWD=;DATABASE=FinalMultiple;"
> oCn.Execute SQLString
> Set oCn = Nothing
> However I've run into a much more amusing issue given that
> I can't figure out how to access to the query results from
> the ActiveX script (a column and many fields).
> Could anybody be so kind to tell me how can I see from VBS
> the query results?
> TIA
> Greetings,
> David Grant|||Thank you very much Dan, your code has really helped me a
lot!! :)
Greetings,
David Grant
>--Original Message--
>You need a recordset object. Code snippet:
>Set oRs = oCn.Execute(SQLString)
>Do While oRs.EOF = False
> 'process each row here
> cod = oRs.Fields("COD").Value
> oRs.MoveNext
>Loop
>
>--
>Hope this helps.
>Dan Guzman
>SQL Server MVP
>|||I'm glad it help you out.
Dan Guzman
SQL Server MVP
"David Grant" <anonymous@.discussions.microsoft.com> wrote in message
news:03e901c52934$6045c2f0$a401280a@.phx.gbl...
> Thank you very much Dan, your code has really helped me a
> lot!! :)
>
> Greetings,
> David Grant
>
No comments:
Post a Comment