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
I am not able to update the dBase database through VB Code.
Can anybody help me out of this?
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!
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.
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![something] = something else
'or you can do direct updates like
strSQL = "DELETE ... WHERE ...));" 'or update, or insert into etc etc
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!!!
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...
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.
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.