I found this which is a triple-linked list box. But by looking at the query statement it has many tables. All I need is for one table. I have one field for books, one for chapters, one for verses and one for text. How do I change it?
Code:
<%
' -----------------------------------------------
' this is a sample that shows how to call the
' "TripleLinkedList" function...
' -----------------------------------------------
Dim Conn
Dim sQuery
' -----------------------------------------------
' first open a connection....
'
' NOTE: to use this in your own site,
' simply change the conn.open call
' to point to your own copy of the "pubs"
' database...
' -----------------------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "pubs", "sa", ""
' -----------------------------------------------
' then set up a query
' -----------------------------------------------
sQuery = "SELECT p.pub_id, p.pub_name, t.title_id, t.title AS title_name, " & _
"ta.au_id, a.au_fname + ' ' + a.au_lname AS au_name " & vbCrlf & _
"FROM publishers p, titles t, titleauthor ta, authors a " & vbCrlf & _
"WHERE p.pub_id=t.pub_id " & vbCrlf & _
" AND ta.title_id=t.title_id " & vbCrlf & _
" AND a.au_id = ta.au_id " & vbCrlf & _
"ORDER BY pub_name, title, ta.au_ord "
' -----------------------------------------------
' the whole thing should be inside a <FORM> def
' -----------------------------------------------
%>
<FORM id=form1 name=form1>
<CENTER>
<%
' -----------------------------------------------
' the function will return a string containing
' the three listbox/combobox form elements
' that you can print or deal with however you want.
'
' see comments in the function definition
' for info on calling parameters...
' -----------------------------------------------
Response.Write TripleLinkedList(Conn, sQuery, "fieldname", 10, "pub_name", "title_name", "au_name", "au_id")
' -----------------------------------------------
' make sure you close and free your connection
' -----------------------------------------------
Conn.Close
Set Conn = Nothing
' -----------------------------------------------
' add anything else you want...
' -----------------------------------------------
%>
<P>
<INPUT TYPE=SUBMIT NAME="foo" VALUE="Buy This Car!">
</FORM>
</BODY>
</HTML>