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.CreateObject("ADODB.Connection")
cDatabasePath = Server.MapPath("/DATA")
connstr = "Driver={Microsoft Visual FoxPro Driver}; UID=;SourceDB="&cDatabasePath&";SourceType=DBF;"
cn.Open connstr
adOpenStatic = 3
%>
<%
Dim rs_aMBL
Set rs_aMBL = CreateObject("ADODB.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.Recordcount
IF nRecNewMBL > 0 THEN
Dim rs_Master_MBL
Set rs_Master_MBL = CreateObject("ADODB.Recordset")
sqlStr = ""
sqlStr = sqlStr & "SELECT * "
sqlStr = sqlStr & " FROM "
sqlStr = sqlStr & cTableMasterMBL
rs_Master_MBL.Open sqlstr, connStr, 1,3
rs_Master_MBL.AddNew
CALL Update_MBL
rs_Master_MBL.Update
END IF
SUB Update_MBL
rs_Master_MBL.Fields("FIELD1") = rs_aMBL.Fields("FIELD1")
rs_Master_MBL.Fields("FIELD2") = rs_aMBL.Fields("FIELD2")
.
.
.
rs_Master_MBL.Fields("FIELD99") = rs_aMBL.Fields("FIELD99")
END SUB
The error happening on the rs_Master_Mbl.update statement.
Thank you in advance for your attention.