|
-
Oct 12th, 2000, 04:51 AM
#1
Thread Starter
Hyperactive Member
Can one create an array with vbscript and if so, how??
What I want to do is select a field from a table and populate the array with the result of all the records which was returned, close the connection and recordset and then later in my HTML populate a dropdown menu with the results in the array.
This way I save on open connections/recordsets etc.
Any help??
-
Oct 12th, 2000, 10:05 AM
#2
Frenzied Member
Code:
Dim arrMyArray
Dim strSQL
Dim cn
Dim rs
Set cn = Server.CreateObject("ADODB.Connection")
cnCn.ConnectionString = "Provider=SQLOLEDB;Server=" & SVR & ";Database=" & DB & ";UID=" & USER & ";Pwd=" & PWD & ";"
cnConn.Open
strSQL = "Select * from Table"
Set rs = cn.Execute strSQL
arrMyArray = rs.GetRows
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
This creates a two dimensional array:
arrMyArray(columns, rows)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|