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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to dump the contents of a .dat file to a delimited text file

Status
Not open for further replies.

WornOut

IS-IT--Management
Jan 10, 2002
5
ZA
I've run out of options on what to do next..

Objective:
I need to dump the contents of a .dat file to a delimited text file, using Visual Basic 6.

Problems:
*I seem to be unable to edit the file, field and index.ddf files as I keep getting errors 46 and 94 (Permission ?) although they have no attributes.

*I wrote some VB code, and when I run it, I get "Table not found" and when I remove the .Dat part of the connection, I get an "unspecified error". I'm also using Microsoft Activex Data Objects 2.5 library.

Private Sub Form_Load()
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseServer
rs.Open "CashAcct.dat", "Provider=PervasiveOLEDB;Data Source=c:\forex", adOpenDynamic, adLockReadOnly, adCmdTableDirect
End Sub

* I tried using BtSearch32 to edit the file.ddf and although the files that I want to use appear in the description, no fields are enabled for me to select for export, except file, field and index.

* I went to SWSoft's website for Colibri's ODBC and they have removed it for download purposes.

Can anyone offer some sort of help ?

Thanx !!




 
I cannot tell you how to do it from VB but there is a real handy btreive file utility called btviewer that can do it for you. Search for it on the web. It is shareware. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
FILE.DDF and FIELD.DDF are system files and are not updateable using the Btrieve API without the owner name, which is not given out. You should not need to modify them any way. THey are used for interfaces like the ActiveX controls or ODBC. THey are not needed for the Btrieve API.
Using ADO, you cannot open just the file. You would either need to specify the ODBC DSN, or the OLEDB provider. You didn't mention what version of Btrieve (Pervasive.SQL) you're using so it's hard to give specific suggestions.
You should get the DDFs from the vendor of the application. It'll have the proper defintions and you'll be able to use ODBC or OLEDB or ActiveX controls. If you know the structure of the files, you can use the Btrieve API as well. Mirtheil
mirtheil@mirtheil.com
Custom VB and Btrieve development.
 
If you need to export your data to ascii or dbase format you can take a look at BtSearch at You can also perform automated exports using BtSearch with a task scheduler.
Gil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top