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!

How do I query a Client side recordset? Please!

Status
Not open for further replies.

JGKWORK

IS-IT--Management
Apr 1, 2003
342
0
0
GB

Hi, bit desperate for this,

I have selected all records from a table and based on this returned recordset I want to populate 2 drop down boxes (one after the other - using the onchange event), I don't want to have to send the page to the server every time I want to populate a drop down - so...

how do I query the returned recordset from the client side?

The code which setup my recordset is below, how would I query this once the recordset has been returned?

SQL_CntAreaDropDwn = "SELECT * FROM tblContactManagementreasoncodes"
Set RS2 = MyConn.Execute(SQL_CntAreaDropDwn)

MANY THANKS - very much appreciated..
 
There are sveeral posts in the FAQs section that deal with chaining dropdowns, these may help as the ines that don't require trips back to the server store the data locally in javascript, which maybe what your looking for.

-T

[sub]01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111[/sub]
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
You don't. Thats not how it works. As a client you receive the final HTML result formed from your actions in the browser. Remember, the recordset is created serverside, the results mined and populated into the HTML page serverside, and the results served to you - All you get is HTML with the result boxes filled. If you want a 'copy' of the results returned by the recordset, so you (the client) can use them for client side operations (i.e. repopulating a drop down box without resubmitting the form), you can use Javascript.

On the ASP page, or VB6 DLL, you will need to write something to write the recordset results into javascript on your page. If it was an ADODB connection inside ASP for instance, you could do:


<script type=javascript>

var resultarr = new Array(

<%

For x = 0 To MyRecordSet.RecordCount

Response.Write("new Array(" & MyRecordSet.Fields(0).Value & "," & MyRecordSet.Fields(1).Value & ")")

Next x

%>

);



You should now have a '2Dimensional' array you can use to offline update your combo/dropdown boxes.

My JavaScript may be a bit off, so check:


For the exact syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top