cannot retrieve the inserted values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bazubwabo
    New Member
    • Nov 2006
    • 14

    cannot retrieve the inserted values

    hi everybody ,
    could u please help me to find out the error on my asp codes,i can't retrieve the inserted values.
    Here is below the code:

    <%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <%
    connect_string = "Driver={SQ L Server};Server= NLROSDBCL9-10;Database=Sca nners;Uid=scann ers;Pwd=bertran d;"

    set dbConn = Server.createOb ject ("ADODB.connect ion")
    dbConn.open connect_string

    mySQL ="select * from EMPLOYEE,DEPART MENT,SCANNER,TE CHNICALDESCR WHERE EMPLOYEE.emplNO =SCANNER.emplNO AND EMPLOYEE.dprtNo =DEPARTMENT.dpr tNO AND SCANNER.scandes cr=TECHNICALDES CR.scandescr"


    set result=dbConn.e xecute(mySQL)

    On Error Resume Next
    If result.eof then
    response.write "There are no records."
    Else
    Do while NOT result.eof
    Response.write result("EMPLNO" )
    Response.write result("EMPLNAM E")
    Response.write result("EMPLSTA RTDATE")
    Response.write result("EMPLSTA TUS")
    Response.write result("DPRTNO" )
    Response.write result("SCANNO" )
    Response.write result("SCANDES CR")
    Response.write result("DOCUMEN T")
    Response.write result("FILES")
    Response.write result("DPRTNAM E")
    Response.write result("DPRTLOC ATION")
    Response.write "<br>"
    result.MoveNext
    Loop
    End if

    result.Close
    Set result =Nothing
    dbConn.Close
    Set dbConn = Nothing


    %>



    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#99999 9">
    <form action="scanner 2.asp" method="post">
    <table >
    EMPLOYEE
    <tr>
    <td height="70">Emp lNO </td> <td ><input name="emplNo" type="text"> </td>
    <td >EmplName</td> <td ><input name="emplName" type="text"></td>
    <td >EmplStartdat e</td><td ><input name="emplStart Date" type="text"></td>
    <td >EmplStatus</td><td ><input name="emplStatu s" type="text"></td>
    <td >DprtNo</td><td ><input name="DprtNo" type="text"></td>
    </tr></table>

    <table>DEPARTME NT
    <tr>
    <td height="70">Dpr tNo</td><td><input name="DprtNo" type="text"></td>
    <td>DprtName</td><td><input name="DrptName" type="text"></td>
    <td>DprtLocatio n</td><td><input name="DprtLocat ion" type="text"></td>
    </tr>
    </table>
    <table>SCANNE R
    <tr>
    <td height="70">Sca nNo</td><td><input name="ScanNo" type="text"></td>
    <td>ScanDescr </td><td><input name="ScanDescr " type="text"></td>
    <td>EmplNo</td><td><input name="EmplNo" type="text"></td>
    </tr>
    </table>

    <table >TECHNICALDES CR
    <tr>
    <td height="70">Sca nDescr</td>
    <td><input name="ScanDescr " type="text"></td>
    <td>Document</td><td><input name="Document" type="text"></td>
    <td> Files</td>
    <td><input name="Files" type="text"></td>
    </tr>
    </table>
    <td width="50">&nbs p;&nbsp;
    <input name="Insert" value="Insert" type="submit"></td>
    <td width="50">&nbs p;&nbsp;&nbsp;< input name="Reset" value="Reset" type="reset"></td>
    </table>
    </form>
    </body>
    </html>

    Best regards,
    Bazubwabo J.B.
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Originally posted by bazubwabo
    hi everybody ,
    could u please help me to find out the error on my asp codes,i can't retrieve the inserted values.
    Here is below the code:

    <%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    <%
    connect_string = "Driver={SQ L Server};Server= NLROSDBCL9-10;Database=Sca nners;Uid=scann ers;Pwd=bertran d;"

    set dbConn = Server.createOb ject ("ADODB.connect ion")
    dbConn.open connect_string

    mySQL ="select * from EMPLOYEE,DEPART MENT,SCANNER,TE CHNICALDESCR WHERE EMPLOYEE.emplNO =SCANNER.emplNO AND EMPLOYEE.dprtNo =DEPARTMENT.dpr tNO AND SCANNER.scandes cr=TECHNICALDES CR.scandescr"


    set result=dbConn.e xecute(mySQL)

    On Error Resume Next
    If result.eof then
    response.write "There are no records."
    Else
    Do while NOT result.eof
    Response.write result("EMPLNO" )
    Response.write result("EMPLNAM E")
    Response.write result("EMPLSTA RTDATE")
    Response.write result("EMPLSTA TUS")
    Response.write result("DPRTNO" )
    Response.write result("SCANNO" )
    Response.write result("SCANDES CR")
    Response.write result("DOCUMEN T")
    Response.write result("FILES")
    Response.write result("DPRTNAM E")
    Response.write result("DPRTLOC ATION")
    Response.write "<br>"
    result.MoveNext
    Loop
    End if

    result.Close
    Set result =Nothing
    dbConn.Close
    Set dbConn = Nothing


    %>



    <html>
    <head>
    <title>Untitl ed Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body bgcolor="#99999 9">
    <form action="scanner 2.asp" method="post">
    <table >
    EMPLOYEE
    <tr>
    <td height="70">Emp lNO </td> <td ><input name="emplNo" type="text"> </td>
    <td >EmplName</td> <td ><input name="emplName" type="text"></td>
    <td >EmplStartdat e</td><td ><input name="emplStart Date" type="text"></td>
    <td >EmplStatus</td><td ><input name="emplStatu s" type="text"></td>
    <td >DprtNo</td><td ><input name="DprtNo" type="text"></td>
    </tr></table>

    <table>DEPARTME NT
    <tr>
    <td height="70">Dpr tNo</td><td><input name="DprtNo" type="text"></td>
    <td>DprtName</td><td><input name="DrptName" type="text"></td>
    <td>DprtLocatio n</td><td><input name="DprtLocat ion" type="text"></td>
    </tr>
    </table>
    <table>SCANNE R
    <tr>
    <td height="70">Sca nNo</td><td><input name="ScanNo" type="text"></td>
    <td>ScanDescr </td><td><input name="ScanDescr " type="text"></td>
    <td>EmplNo</td><td><input name="EmplNo" type="text"></td>
    </tr>
    </table>

    <table >TECHNICALDES CR
    <tr>
    <td height="70">Sca nDescr</td>
    <td><input name="ScanDescr " type="text"></td>
    <td>Document</td><td><input name="Document" type="text"></td>
    <td> Files</td>
    <td><input name="Files" type="text"></td>
    </tr>
    </table>
    <td width="50">&nbs p;&nbsp;
    <input name="Insert" value="Insert" type="submit"></td>
    <td width="50">&nbs p;&nbsp;&nbsp;< input name="Reset" value="Reset" type="reset"></td>
    </table>
    </form>
    </body>
    </html>

    Best regards,
    Bazubwabo J.B.

    Hi there,

    Are the fieldnames / tablenames spelled correctly? Is the any error message being prompt / thrown while executing this code? Good luck & Take care.

    Comment

    • bazubwabo
      New Member
      • Nov 2006
      • 14

      #3
      thanks for your reply ,
      indeed i have received an error message ("there are no records").
      By the way,i don't know right now wether the problem is over the code: i can't anymore retrieve the inserted values
      Could please hepl me to find out the error.

      Regards,
      Bazubwabo J.B.
      IT student

      Comment

      • sashi
        Recognized Expert Top Contributor
        • Jun 2006
        • 1749

        #4
        Originally posted by bazubwabo
        thanks for your reply ,
        indeed i have received an error message ("there are no records").
        By the way,i don't know right now wether the problem is over the code: i can't anymore retrieve the inserted values
        Could please hepl me to find out the error.

        Regards,
        Bazubwabo J.B.
        IT student

        Hi there

        Can you please double check the 4 tables (EMPLOYEE,DEPART MENT,SCANNER,TE CHNICALDESCR) invloved to make sure the are data in it. Just in case, this will narrow down posibilities in terms of debuging yuor code. Good luck & Take care.

        Comment

        Working...