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

Selectbox from Database Table

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I do have a problem. I have an Access Database with some tables("Player"; "Sportkind" etc..) and I would like to create in Javascript (Client side)a dynamic select Box, which hold automaticly all players who exists in the database. When I select one of them, so the second Selectbox will be updated and shows all sports which the selected player is doing.
The connection to the Database is done with "ADODB" And I´ve already created the Recordsets which I need. I hope you can help me please!!!
Thanks!
Mamo
PS. Pleas write me on: Elmam@gmx.de
 
All that I can say - it's not recommended. If you want i'll explain in details why.
Recommended style is connecting to database on serverside. So you should do something like following:
[ol][li]If number of players and number of sportkinds by player is resonable
grab both tables to javascript array. On server-side generate something like following:
Code:
pArr = new Object()
pArr['John'] = new Array('Football', 'Skiing')
pArr['Sam'] = new Array('Tennis')
...
[/li]
[li]If number of players is resonable, but number of sportkinds by player is big
Code:
sArr = new Array('Football', 'Skiing', 'Chess', 'Tennis')
pArr = new Object()
pArr['John'] = new Array(0, 1)
pArr['Sam'] = new Array(3)
...
[/li]
[li]If numbers are big you have no other choice except reload page sending selected player as parameter.[/li][/ol] [sig]<p>Michael Dubner<br>Brainbench MVP/HTML+JavaScript<br>
[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top