Solved

Convert .dat database into .mdb

Posted on 1998-10-12
10
8,682 Views
Last Modified: 2013-12-25
Hi,
In VB5, how can i access any database(.dat), read every record, then convert it to Recordset, & save as (.mdb) database ?

NB: The (.dat) database & its fields are specified by the user in run-time, thus, how can i use VB5 to detect the dbase fields, & subsequently create them in (.mdb) ?

Looking forward to ur reply,
Collin
0
Comment
Question by:collinng
10 Comments
 
LVL 5

Expert Comment

by:chewhoung
ID: 1496858
What database is (.dat) file?
0
 

Author Comment

by:collinng
ID: 1496859
(.dat) which i encounter is a SCALA4.0 databases. Assume it is a normal databases (eg. .dbf, or .txt), is it possible to detect/capture the fields & widths of a database in VB5.0 ?

Cheers,
Collin
0
 
LVL 3

Expert Comment

by:vmano
ID: 1496860
there is a MSDN article which shows how to convert a ASCII text file in to Access Database from scratch. the URL is :
http://support.microsoft.com/support/kb/articles/q103/8/07.asp

let me know if this helps,
vmano
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:collinng
ID: 1496861
Hi, i would appreciate it if someone could give me another web-site address with answers to my question. i don't subscribe MSDN :)

Collin
0
 

Author Comment

by:collinng
ID: 1496862
vmano,
sorry i managed to get in & read the article from the web-site u give. Thanks!.
Do u know whether VB5.0 can read binary file in RecordSet ? Or i need to open it using Seq & Random access method for Binary .dat file ??

cheers,
Collin
0
 
LVL 1

Expert Comment

by:sirigere
ID: 1496863
.dat file is a SQL server datbase database file is it?
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1496864
What system or program makes the .dat file you wish to read?

Its easy to read files using binary file i/o in vb:
buf$=space$(50)  'input record buffer for record len=50
open "MyFile" for binary as #1
while not eof(1)
 get #1,,buf$
 'do something with the stuff here, like
  'make an insert statement "Insert into tblnam(fld1,fld2..)
   'values("+fld1+","+fld2...)
  'and use .execute on the connection object to insert data
wend
close #1

Or you can create a type structure to read the records into and break down into fields via the type udf.
0
 
LVL 1

Expert Comment

by:sdbanks
ID: 1496865
I see two parts to your question.  The first is that you need to be able to read the .Dat File; and the second is being able to import the field information to an mdb file.  Reading through the comments I get the feeling that more information is needed about your database source.  I did a search on the web for SCALA and found a Business Administration Systems.  This system has a statistics module that allows you to export information so that it can be used in spreadsheets and so on.  Is this what you are doing?


0
 

Author Comment

by:collinng
ID: 1496866
sdbanks, & all,

your rephrasing of my question is Right. Thanks.
(i)to read the .dat Scala data file, my recent soln is to use Scala's provided odbc driver (pervasive odbc) and access a .dat in a network drive. (Qn) However, is there a way to read the .dat file in my local harddisk c:\ ??

(FYI, true enough i can export a statistics module to xls, but i/we are now trying to read/export other modules like general-ledger, sales-ledger, and all rest, inorder to consolidate with same modules in other geographic location.Scala does not provide export of other modules, although it can read/display them.)
 
(ii) to export to mdb database from .dat
tentatively, i would use MS Access(mdb) to link to Scala .dat files, using (pervasive) odbc drivers, and VBasic will open Access(mdb) and access them.
Is it advisible to use DAO recordset in VBasic to access Scala .dat files, using odbc ? without going through MS Access ?


Cheers,
Collin
0
 
LVL 1

Accepted Solution

by:
sdbanks earned 150 total points
ID: 1496867
Sounds to me like you already know exactly what to do:

1.  Create a ODBC connection to the Databases files as provided by the company.
2.  Create an msAccess that would link to the tables in the database.
3.  Create another msaccess database which will contain the fields you require.
4.  Write your program so that it reads the information from the source table and puts it into the destination table.  I would make the source table open a snapshot so it is read-only...Better performance and less chance of writing to wrong table.

Steven
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question