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

Get recordset with RemoteScripting 1

Status
Not open for further replies.

rtshort

IS-IT--Management
Feb 28, 2001
878
US
I have set up a client page and a server page. I can access them both directly without errors. (had some at first, couldn't find include file, & etc.) Now I think everything is working right but I can't figure out how to get the value of the recordset back to the calling page. The client page is .asp and not .htm because I fill the first combo box on Window_OnLoad.

To get the recordset the code goes something like:

Do Until rs.EOF = True
EngMake = rs.Fields("blah blah")
rs.MoveNext
Loop

I can use response.Write on the asp page and get all of the values so I think that part is working. I just can't figure out how to get the EngMake to the calling page and added to the combo box. Rob
Just my $.02.
 
This does present some difficulty. The way I have gotten around this is on the server concatenate the recordset into a single string and then break it apart again on the client web page.

Code:
public function myFunction()
dim EngMake

... declare and create recordset ...

Do Until rs.EOF = True
EngMake = EngMake & "~" & rs.Fields("blah blah")
rs.MoveNext
Loop

... cleanup code ...

myFunction = EngMake
end function

Back in the web browser use JavaScript (or VBScript if that is what you are using), split the returned string into an array. Use the ~ as the divider to split on. Then you would loop through the array and add the values to the combo box in your normal fashion.

There is one other way that may work better for you. You can create your server asp page as an object in your web page. You can then write you code so that you can get the recordset values and add them to your combo box. As good website on how to do this is Click on the link Referencing ASP Pages as Objects.


Hope this helps,

Gabe
 
Thanks Gabe, that should set me on my way. Rob
Just my $.02.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top