Solved

Convert .dat database into .mdb

Posted on 1998-10-12
10
8,613 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now