Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2002
    Location
    belgaum-karnataka-india
    Posts
    1

    Unanswered: updating dBase files through VB code

    Hello,
    I am an intermidiate level VB Developer.I am developing an
    application in VB6 for Hotels.I am maintaining database in Access for
    my application. Now the customer is using another application for
    accounting purpose which uses Clipper/dBase combination.He wants me
    to make entry to this dBase database while a bill is prepared through
    my VB application, to avoid makimg mannual entries to his accounting
    software.
    I am not able to update the dBase database through VB Code.
    Can anybody help me out of this?
    Regards
    Shreeniwas bhide

  2. #2
    Join Date
    Jul 2001
    Location
    NC
    Posts
    102
    Several years ago, when I attempted to use VB6 with clipper/xbase, it intermittently caused "not a dbase file" errors, and was unable to handle the IDX, CDX and NSX indexing. Haven't used xbase since. Good luck!

  3. #3
    Join Date
    Mar 2002
    Location
    CA
    Posts
    1
    Problem: Microsoft does not support updating dbase tables in it's newer data access components. This is a political thing with the makers of dbase... yada yada yada

    Solution: Use an older solution, specifically DAO version 3.5. It works beautifully, and is actually quicker than ADO.

    Code base:
    Dim db as database
    Dim rs as recordset
    Dim strSQL as string

    Set db = DBEngine.Workspaces(0).OpenDatabase("C:\DataPath\" , 0, 0, "dBase III;")

    strSQL = "SELECT ... From ... WHERE ...";"
    Set rs = db.OpenRecordset(strSQL)

    'if you want to edit do something like
    rs.addnew
    rs![something] = something else
    rs.update

    'or you can do direct updates like
    strSQL = "DELETE ... WHERE ...));" 'or update, or insert into etc etc
    db.Execute strSQL

    The only real catch here is that you have to add the older DAO 3.51 object library to your app, but I have had a similar situation (older app written in clipper with dbase tables) and I like the performance of the dbase so much better than the mdb files that I am sticking with it!!!

    Hope it helps!

  4. #4
    Join Date
    Jan 2003
    Posts
    1

    Problem with Dbase Indexes

    Hi

    I have the same problem as Shreeniwas bhide, I tried the DAO 3.51 provider, it really works by opening and updating the dabse files, but the problem is that the index files (*.mdx) are not updated too.
    So I have to reindex the tables after each time i post transactions through my VB program, to be able to open the delphi/Dbase program.

    So please if you have any solution about updating the indexes files when updating the database files let me know...

  5. #5
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251

  6. #6
    Join Date
    Jan 2003
    Location
    LA, CA
    Posts
    3

    A similiar problem

    I am using a similiar method to pull data in from a series of dBase tables in a VB6 app, but am having a different problem. Any help would be greatly appreciated. The app works fine except when opening certain tables, it generates the error: External table isn't in the expected format. Interestly these same files are not able to open with Excel either, however they do open with various dbf viewing apps I found on download.com. In your example, the error would occur on the line: Set rs = db.OpenRecordset(strSQL)

    My thinking is that there is some issue with the way that Jet is looking at this table, and is therefore not able to open it. I have tried changing to dBase III, dBase IV and referencing DAO 3.5, 3.1, etc. nothing seems to work.

    Any thoughts?

    Thanks in advance.

  7. #7
    Join Date
    Nov 2002
    Location
    San Francisco
    Posts
    251
    unfortunatelly DBF extension was used for many different database formats

    dBase III+, IV and 5
    FoxBASE+
    FoxPro
    Visual FoxPro
    Clipper
    HiPer-SIx


    so task number one is to find out the source....

    check this web page for some info....
    http://alxsoft.narod.ru


    jiri

  8. #8
    Join Date
    Jan 2003
    Location
    LA, CA
    Posts
    3
    Thanks for the reply. The source is an application that creates a series of files as sort of an export according to a definition. The definition states only that the files are 'dBase'. Looking closely it seems that they vary from dBase III to dBase IV. When isolating a single file for testing purposes, it doesn't seem to make any difference if I specify III or IV.

    Thanks,

    TS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •