Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. VC++ - ODBC : can't reach the last records of my file.dbf

VC++ - ODBC : can't reach the last records of my file.dbf

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionannouncement
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qadddd
    wrote on last edited by
    #1

    I used ODBC "dBase files" to access a file GSTAT.DBF, my code is the following : DBName = GlobalDSN + "Gstat;UID=;PWD:"; ErrMsg = ""; res = "SELECT DATUM,CASHT,MCASHT,NETROOM,MNETROOM from GSTAT WHERE (DATUM = #08/01/2004#)"; gDB.OpenEx(DBName,CDatabase::noOdbcDialog); TRY { rs.Open( CRecordset::forwardOnly, res ); NbRecord = rs.GetRecordCount(); } CATCH(CDBException, e) .... The problem is that it works perfecly on the 1061 first records, but it refuses to find me the records 1062-1068 (1068 being the last record in file)... and I wonder why ? I thought that it could be due to a problem with MSjet 4.0 dll because mine is quite "old" (as far as I can see, my version 4.0.4431.3 is from SP5. I downloaded the SP8 from MS, but when I was to install it, I receive a message from the installation program saying that my version is too old and that I should have at least the SP3 ... Once again, I don't know why Any idea on 1st or 2nd of my problem will be appreciated DD

    Q 1 Reply Last reply
    0
    • Q Qadddd

      I used ODBC "dBase files" to access a file GSTAT.DBF, my code is the following : DBName = GlobalDSN + "Gstat;UID=;PWD:"; ErrMsg = ""; res = "SELECT DATUM,CASHT,MCASHT,NETROOM,MNETROOM from GSTAT WHERE (DATUM = #08/01/2004#)"; gDB.OpenEx(DBName,CDatabase::noOdbcDialog); TRY { rs.Open( CRecordset::forwardOnly, res ); NbRecord = rs.GetRecordCount(); } CATCH(CDBException, e) .... The problem is that it works perfecly on the 1061 first records, but it refuses to find me the records 1062-1068 (1068 being the last record in file)... and I wonder why ? I thought that it could be due to a problem with MSjet 4.0 dll because mine is quite "old" (as far as I can see, my version 4.0.4431.3 is from SP5. I downloaded the SP8 from MS, but when I was to install it, I receive a message from the installation program saying that my version is too old and that I should have at least the SP3 ... Once again, I don't know why Any idea on 1st or 2nd of my problem will be appreciated DD

      Q Offline
      Q Offline
      Qadddd
      wrote on last edited by
      #2

      ok, i have found my 1st problem ... it is due to the wrong date format I passed in the WHERE clause, it must me in the US format (MM/DD/YYYY) and I was giving it in french format (DD/MM/YYYY) ... So, I don't need to upgrade the MSJet stuff Nevertheless, I would like to know if anyone has an idea on the strange message displayed by the prog supposed to upgrade MSJet ... Regards DD

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups