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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ARRAY HELP NEEDED

Status
Not open for further replies.

DMG2000

Programmer
Aug 13, 2000
52
US
Is it possible to hold database field info within a array?<br><br>My &quot;non-working&quot; code: <br>aParameters = Array ([DBItem(&quot;ProductName&quot;)] [DBItem(&quot;Description&quot;)][DBItem(&quot;SalePrice&quot;)])<br><br><br>
 
I'm not sure how this translates to VBScript but here is some Javascript:<br><br>var rs = Server.CreateObject(&quot;ADODB.Recordset&quot;);<br>// obtain rowset<br><br>var myValues = new Array();<br>myValues[0] = new String(rs(&quot;ID&quot;));<br>myValues[1] = new String(rs(&quot;FirstName&quot;));<br>myValues[2] = new String(rs(&quot;LastName&quot;));<br><br>Good luck<br>-pete
 
Ahhh Javascript.....it worked well Pete! Thanks!!!<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src= <br><br>DMG2000
 
I think you were very nearly there in VB script except that you left out the commas. Kinda accademic now but try<br><br>aParameters = Array (DBItem(&quot;ProductName&quot;),DBItem(&quot;Description&quot;),DBItem(&quot;SalePrice&quot;))<br><br>Pat<br><br><br>
 
Yeah I tried that code before evening posting here. I just could not grasp it with VB, but works like a charm in&nbsp;&nbsp;Javascript....I guess I was doing too much SQL programming, had basic in the brain!<br><br>Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top