Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Accessing Btrieve using VB6 2

Status
Not open for further replies.

jbrowne

Programmer
Feb 1, 2000
182
IE
Hi,
I'm converting a project from VB3 to VB6. In the VB3 version, I am accessing a Btrieve database using the ISAM driver included in VB3 through the jet engine using dao. VB6 no longer provides an ISAM driver (no 32 bit equivilent) so we have to try to access thru ODBC. The problem with this is that because we are no longer using the jet workspace - dao does not support the "seek" method which is used extensively throughout the project. I have been given advise to convert to ado but I am not very familiar with ado.
Would the conversion mean extensive code changes or does anyone know if there is a better solution ??

Thanks in advance
John B
 
John B,

I am in a similar position. I have discussed this with Pervasive on a couple of occassions - with no real answer. You can (according to Pervasive) only use ADO with the Pervasive database engine, NOT the BTRieve engine.

If you find out something different, or even if you find a way to use ADO with the BTrieve engine, I would like to know. I am currently using the BTRieve API calls via a Class for each data table. It is strictly a manual coding effort for everything, but it is also VERY FAST.

We are doing this for the speed and also to avoid the HIGH cost of the Pervasive SQL distribution for ou customers. But the 'cost' in development is HUGE.


MichaelRed
There is never time to do it right but there is always time to do it over
 
It would seem that both of you know a great deal more about BTrieve than I, so perhaps you can help me solve my problem.

Our old Macola System is in Btreive format and we are trying to access the data via ODBC using Pervasive's drivers.

I cannot get the Pervasive ODBC drivers to function properly. Have either of you been able to connect properly using these drivers?

If not, what solutions have you come up with to create such a connection?

Thanks in advance,

Antoni Paleshi
 
Antoni,

I have (so far) only used VB with the BTrieve 'Direct Application Calls'. This is (somewhat) facilliated by encapsulating the BTrieve records and accesses in class modules - one per BTRieve table/file. The 'class' module(s) handle only one record per access, so any sorting/grouping is done by loops tehrough the files and collecting the results in arrays ...

All of the above is via instantiating the BRtieve run time engine with a simple declaration statement (and - of course - the actual BTrieve run time engine). Some constant declarations are also included for convenience/documentation purposes.
 
Cool!!! Seems I'm not the only guy trying to access Btrieve.
I'm trying to access Btrieve 5.0 files trough a macro in Excel 97 .Now the problem is that there is no 32-bit Windows Requester available for this version of Btrieve. On the other hand , trying to use wbtrcall.dll gives me an error because it's a 16-bit dll. Any ideas on how to call a 16-bit dll from a 32-bit macro?
capnemo
 
I'm trying to write a VB6 program, that reads one record from one btrieve file and writes it to another btrieve file. So far I was not successful to usa the ADO interface, it is way to slow. I was wondering, if anybody has some sample of VB how to open the table, find one record and pass it to another table.

Thanks

Susi
 
We are using VB6 and ADO to access a Btrieve database through ODBC. This works fine, as long as you have the version of the ODBC driver which corresponds to the version of the Btrieve database you are accessing.

Another useful hint is that the order in which tables appear in the SQL seems to affect the query plan which will be used, and therefore the performance. If your queries are slow, try rearranging your SQL statement.

If anyone knows the whereabouts of an OLE DB driver for Btrieve, please let me know - brettd@sah.org.au
 
The folks at SWsoft are offering an OLE DB driver for Btrieve. I've downloaded the trial version (which appears to be fully functional), but haven't played too much with it...their pricing for redistribution looks a bit too steep for my clients, but, not knowing your situation, you may find it reasonable.

You can find the download here:

 
Hi All

I've got exactly the same problem as John. The code runs through but it doesn't update the Btrieve database. I was wondering if you got it working?

Thanks
Martin Oosthuizen
 
Martin,

I have actually converted to ADO and I had to convert the Btrieve DAT files to the currect version of Pervasive MKD files. I also needed to purchase the Pervasive SQL2000 SDK which includes the engine and OLEDB provider that is needed. It is working quite well - still an odd problem with seek but updating records is no longer a problem.
Hope this helps you or at least gives you an idea of whats involved in making things work.

John B
 
Martin,

I have actually converted to ADO and I had to convert the Btrieve DAT files to the currect version of Pervasive MKD files. I also needed to purchase the Pervasive SQL2000 SDK which includes the engine and OLEDB provider that is needed. It is working quite well - still an odd problem with seek but updating records is no longer a problem.
Hope this helps you or at least gives you an idea of whats involved in making things work.

John B
 
One alternative is the Classic Software Custom Control. It allows DAO-Like access to Btrieve in VB5 / 6 (I know - we use it here).

Also, if you can, upgrade to Pervasive.SQL. We just did (not actually complete, but the engines are in place) and cut the time taken by long-running, heavy-DB processes by about 40% on the average. With SP3 out now, full ADO functions (Including Index and Seek) are available. As soon as we get our site updated to SP3, we'll be converting from the Custom Control to ADO.
 
Is There another way to access Btrieve Database File. I've problem like MichaelRed that the pervasive SQL is very high COST.
I need the activex control or another control which I can get the data from Btrieve by coding VB program and sent this data to other database structure such ms-access database(*.mdb).
Well!! I need your help where I can get this control or ODBC driver, Please help me.
 
In order to access a Btrieve database, you need to have the Btrieve engine. I'm not sure where you're looking at the Pervasive engine but a single user version is only $25 USD from the Pervasive website. You can use the Pervasive ActiveX control or the Classic Control. Both will still need a Pervasive/Btrieve engine. The Pervasive control is downloadable from the Pervasive Developer Center ( As far as the ODBC driver, it's included with the Pervasive.SQL 2000 engine. info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
If you just need a one time conversion of your btrieve data you can take a look at BtSeach at While it requires that you have your DDF files if you do not you can use it to analyze your existing files and build these DDF's. Then you can export to dbase or ascii formats which can be easily imported into other databases.

Gil
 
I've just downloaded the pervasive 200i workgroup engine and activex component from Pervasive.com. I try to connect my database which are *.dat file by ADO. When I use sql statement there is error &quot;Syntax error : select * from <<???>>&quot; . So anybody can explain me what's that mean and how can I connect my database....
 
What's your connection string? How are you opening the recordset? From the looks of it, you're trying to open a table but haven't specified the table name. Do you have DDFs? Have you created an ODBC DSN?
info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
My database info....
Yes,I have ddf file and table name &quot;part master&quot; which table file name is prtmst.dat (this for example).
I've ODBC DSN name &quot;Intronics&quot;. And this is my code...
>
>
Set rsComB = New ADODB.Recordset
'Set rsComB = .rsCommand10
rsComB.Open &quot;part master&quot;, &quot;Provider=PervasiveOLEDB;Data Source=intronics&quot; _
, adOpenDynamic, adLockOptimistic, adCmdTable
>
>
So, please tell me does pervasive support *.dat table file...this is my notification...thank you very much.
 
I tried that code on my development system and didn't have any problem with it. What is the error you are seeing? You do need to make sure that you're using the proper Database Name for the &quot;Data Source&quot; parameter. When using PervasiveOLEDB, the &quot;Data Source&quot; is actually a database name not an ODBC Datasource Name. THe Pervasive engine can access files with any extension (or no extension). Using PervasiveOLEDB, as long as the DDFs point to the correct Btrieve file names, everything should be good. info@mirtheil.com
Custom VB and Btrieve development.
Certified Pervasive Developer
Certified Pervasive Technician
 
To mirtheil ..
Please inform me what is the environment and code that ir yours. So, I can check and solve my problem...
Well, which betrieve version is supported by pervasive 200i sp3?
Thankyou very much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top