I need to create 2 dropdowns, with the 2nd dropdown dependent on the selection in the 1st. They both need to be loaded from database table fields. The dropdowns must be part of an ASP page. If I create a recordset of all fields when the page loads. Can I requery the same recordset with a key from the 1st dropdown selection and build/display the 2nd dropdown? Any code examples would be greatly appreciated.
Javascript..VBscript..whatever works best.
Hello
I have the same requirement, but I get an error message on the second retrieval of data. the first one works beautifully. See if you can make the code work for your requirement, then let me know what I can do to make it work for me !
My code is :
Option Explicit
<%
Dim MyAudioCategories
Dim cString
Dim query
Public Function GetCategories()
Dim rsAudioCategories
Set MyAudioCategories= Server.CreateObject("ADODB.Connection")
cString = "driver={Microsoft Access Driver (*.mdb)};" & _
"dbq=D:\My Webs in working\d.zignsenterprisesolutions\deeni\_private\desaudiolist.mdb"
MyAudioCategories.Open cString
Set rsAudioCategories = Server.CreateObject("ADODB.RecordSet")
query = "SELECT CategoryName FROM Categories Order By CategoryID"
rsAudioCategories.Open query, MyAudioCategories
Do Until rsAudioCategories.EOF
GetCategories = GetCategories & "<OPTION VALUE=""" _
& rsAudioCategories("CategoryName") _
& """>" & rsAudioCategories("CategoryName") & "</OPTION>"
rsAudioCategories.MoveNext
Loop
rsAudioCategories.Close()
Set rsAudioCategories = Nothing
MyAudioCategories.Close()
Set MyAudioCategories = Nothing
End Function
Public Function GetAudioListByCategory(CategoryName)
Dim MyAudioList
Dim rsAudioList
Dim TempReturn
Dim SqlQuery
Set MyAudioList= Server.CreateObject("ADODB.Connection")
'cString = "driver={Microsoft Access Driver (*.mdb)};" & _
' "dbq=file\desaudiolist.mdb"
MyAudioList.Open cString
Set rsAudioList = Server.CreateObject("ADODB.RecordSet")
Bookmarks