Welcome, Guest
  • Author Topic: Previous/Next record from Access database  (Read 3882 times)

    bobmonkhouse

    • Server what's that
    • *
    • Posts: 1
      • View Profile
    Previous/Next record from Access database
    « on: 01/26/10, 10:10 »
    Hi there,
    Wonder if anyone can help?
    I have managed to search an access database using Flash 8, but I'm struggling to figure out how to get  Previous/Next record buttons.
    My asp file is as follows:

    <%
    Sub OutputParam ( key , value )

    if ( value <> null & Len(value) <> 0 ) then
        Response.Write "&" & key & "=" & server.URLEncode( value )
    end if



    End Sub



    record=request("Record")
    Set objconn=server.createobject("adodb.connection")
    objconn.open "provider=microsoft.jet.oledb.4.0; data source=" & server.mappath("Calm Support Database.mdb")
    set objrecord=server.createobject("adodb.recordset")


    set objrecord=objconn.execute("SELECT Main.* FROM Main WHERE (Main.Organisation Like ""%"& Record &"%"");")


    if objrecord.eof then

    Response.Write "errorMsg=Not Found&Organisation="
    response.end
    else


    Response.Write "errorMsg=Found"
    OutputParam "Organisation", objrecord.Fields("Organisation")
    OutputParam "Account Ref", objrecord.Fields("Account Ref")
    OutputParam "Invoice Address", objrecord.Fields("Invoice Address")
    OutputParam "Delivery Address", objrecord.Fields("Delivery Address")



    end if

    %>

    Behind the search button in Flash is:



    on (release , keyPress "<Enter>") {
     {
       loadVariablesNum("data.asp?Record=" add myrecord, 0);
       myrecord="";
       Organisation="";
       errorMsg="Please wait";
       }
       

    }


    If anyone's got an idea as to the best method I'd be very grateful.
    thanks.