Hi all,
 
I am using the SQLite DB with MS VC++ v 6. In the code below you can see
I am looping around a ODBC connection to an access database and I am
inserting those records into my new SQLite database. My problem is
SQLite.dll causes an access violation after inserting about 190 records.
Does anyone have any ideas what I am missing or if this is a bug?
 
Code...
 
 
  nRecord=0;
  while(pRs->EndOfFile == FALSE)
  {
   nRecord++;
 
   // Create Insert Command

   strCmd = _T("INSERT INTO SCHEMATABLES VALUES(");
   for(int nField = 0; nField < pRs->Fields->Count; nField++)
   {
    var.lVal = nField;
    var.ChangeType(VT_I2, NULL);
    strCmd += _T("\"");
    strCmd += pRs->Fields->GetItem(var)->Value.bstrVal;
    strCmd += _T("\", ");
   }
   strCmd = strCmd.Left(strCmd.GetLength()-2);
   strCmd += _T(");\n");
 
 
   // SQLite .. Insert record into SQLLite Database
   nReturn = procPrepare(pResult, (LPCTSTR)strCmd, -1, &stmt,
&pRemainingSQL);
   nReturn = procStep(stmt);
 
   // MDB
   pRs->MoveNext();
  }
 
  pRs->Close();
 
  nReturn = procClose(pResult);
  str = procErrMsg(pResult);
 
Thank you in advance,
 
Chris
 

Reply via email to