-
List box query
Jo sorry to trouble you. You seem to know alot about asp. I have a listbox which reads options from the database. I have posted the value of the option to another page, I have then used this value to search a database. I want the result to be displayed in a txtbox. Below is the code I have written, but it does not work. It is probably something small could you please make my day again this is for my final year project. You can email me on [email protected]
dim me2, Desc
me2 = request.form("Books")
response.write me2
Set objCon = Server.CreateObject( "ADODB.Connection" )
objCon.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _
Server.MapPath("myManage.mdb") & ";"
objCon.Open
' Open the Recordset
Set objRS = Server.CreateObject( "ADODB.Recordset" )
objRS.ActiveConnection = objCon
objRS.CursorType = 3
objRS.Open "SELECT * FROM Category WHERE CatCode=" & me2
IF NOT objRS.EOF THEN
mo = objRS( "Description" )
END IF
objRS.close
%>
<form action="me.asp" method="post">
<table width="600" border="0">
<tr>
<td><label>Categories</label> </td>
<td><input type="text" name="Desc" value"<%=mo%>"></td>
</tr>
</table>
</form>
</body>
</html>
-
Oddlyenough, the ASP part seems OK... it's the HTML that follows....
you had:
Code:
<input type="text" name="Desc" value"<%=mo%>">
Shoud be:
Code:
<input type="text" name="Desc" value="<%=mo%>">
-
Thanks
Thanks you very much for that. I spent a couple of hours on that and I could not see that tiny mistake. Is it ok if you could email me via msn mess @ [email protected].