Hi all...thanx for reading my post..well what i'm trying to do is
make dynamic depedent listbox....I list down the
code below..the proble is when I tried to run it,an error of "Syntax
error (missing operator) in query
expression"..so is there anybody can help me with this prob?
<HTML>
<HEAD>
<TITLE></TITLE>
<SCRIPT language="JavaScript">
<!--
function verify() {
document.location.href="ListBox1.asp?
maincatid=" + document.forms[0].selCat.value;
}
//-->
'http://www.bullschmidt.com/devtip-querystring.asp
</SCRIPT>
</HEAD>
</BODY>
<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath("db.mdb")
Set oRs = oConn.Execute("select * from main")
%>
<FORM>
Choose an Fruit:
<SELECT NAME="selCat" SIZE="1" ONCHANGE="verify();">
<%
Do while (Not oRs.eof)
%>
<OPTION VALUE="<% = oRs.Fields("fid")%>"><%
= oRs.Fields("catname")%></OPTION>
<% oRs.MoveNext
Loop
%>
</SELECT>
</FORM>
<%
oRs.close
oConn.close
%>
<%
Dim strmaincatid
Dim strSQL
strmaincatid = Request.QueryString("maincatid")
If strmaincatid = "" Then
maincatid = 1
End If
Set oConn1 = Server.CreateObject("ADODB.Connection")
oConn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Server.MapPath("db.mdb")
Set oRs1 = oConn1.Execute("select * from sub where
fid=" & strmaincatid)
%>
<SELECT SIZE="1" id=select1 name=select1>
<%
Do while (Not oRs1.eof)
%>
<OPTION VALUE="<% = oRs1.Fields
("comodities")%>"><% = oRs1.Fields("comodities")%></OPTION>
<% oRs1.MoveNext
Loop
%>
</SELECT>
</FORM>
<%
oRs1.close
oConn1.close
%>
</SELECT>
</BODY>
</HTML>
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error (missing operator) in query expression 'fid='.
/lbox2/ListBox1onepage.asp, line 50
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/