Results 1 to 3 of 3

Thread: List box query

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    5

    Talking 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>&nbsp;</td>
    <td><input type="text" name="Desc" value"<%=mo%>"></td>
    </tr>
    </table>

    </form>

    </body>
    </html>

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    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%>">
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Posts
    5

    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].

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width