ASP table update problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MIHAB
    New Member
    • Apr 2007
    • 1

    ASP table update problem

    Hi everyone.

    I have experienced a weird type of error – something obvious but I can’t get it.
    I am working with the ASP (VBSCRIPT) and FoxPro tables via ODBC. The goal is to update one table using records from another(same structure). The task works perfectly on the small table (300 – 400 records) but giving me the headache with the 6000+ records. Sometimes code works like a charm (on LOCALHOST majority of the time) but most frequently it fails with the error

    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Visual FoxPro Driver]Variable 'Q990P49' is not found


    where variable name is different most of the time.

    Code:

    <%
    set cn = Server.CreateOb ject("ADODB.Con nection")
    cDatabasePath = Server.MapPath( "/DATA")
    connstr = "Driver={Micros oft Visual FoxPro Driver}; UID=;SourceDB=" &cDatabasePath& ";SourceType=DB F;"
    cn.Open connstr

    adOpenStatic = 3
    %>

    <%
    Dim rs_aMBL
    Set rs_aMBL = CreateObject("A DODB.Recordset" )
    sqlStr = ""
    sqlStr = sqlStr & "SELECT * "
    sqlStr = sqlStr & "FROM "
    sqlStr = sqlStr & cTableMBL
    sqlStr = sqlStr & " WHERE BL_Number = '" & cBL_Number & "' AND "
    sqlStr = sqlStr & " BL_Repfac = '" & cRepeat & "' "
    rs_aMBL.Open sqlstr, connStr, 1,3
    nRecNewMBL = rs_aMBL.Recordc ount
    IF nRecNewMBL > 0 THEN
    Dim rs_Master_MBL
    Set rs_Master_MBL = CreateObject("A DODB.Recordset" )
    sqlStr = ""
    sqlStr = sqlStr & "SELECT * "
    sqlStr = sqlStr & " FROM "
    sqlStr = sqlStr & cTableMasterMBL
    rs_Master_MBL.O pen sqlstr, connStr, 1,3

    rs_Master_MBL.A ddNew

    CALL Update_MBL
    rs_Master_MBL.U pdate

    END IF

    SUB Update_MBL
    rs_Master_MBL.F ields("FIELD1") = rs_aMBL.Fields( "FIELD1")
    rs_Master_MBL.F ields("FIELD2") = rs_aMBL.Fields( "FIELD2")
    .
    .
    .
    rs_Master_MBL.F ields("FIELD99" ) = rs_aMBL.Fields( "FIELD99")
    END SUB

    The error happening on the rs_Master_Mbl.u pdate statement.

    Thank you in advance for your attention
    .
Working...