Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting SQL data into an array/variable in VBscript 2

Status
Not open for further replies.

wlfpackr

IS-IT--Management
May 3, 2003
161
0
0
US
Is it possible to extract data from SQL tables into an array with VBscript? Everything I've seen online seems to deal with ASP, but I need an automated script that runs nightly against a SQL DB.

A crude example of what I'm trying to do would be reading in all userID's from a SQL table with a status of "1" into an array so the accounts could be created in Active Directory. I would know how to do the AD side, but not sure where to get started on reading data from SQL (I've always written to) or if it's even possible.

=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
Use an ADODB.Recordset object.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks. I started playing around with this and it is much easier than I originally thought.

BTW, just wondering what is the difference between:

Code:
set objRS = CreateObject("ADODB.Recordset")

set objRS = Server.CreateObject("ADODB.Recordset")

Is the second one used with ASP? I got hung up on this part a little in the beginning after looking through information on ADODB.Recordset on another site. If it's complicated don't worry, I got the answer I originally wanted.


=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
Is the second one used with ASP
Yes, in the server side of the script.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top