Solved

Convert .dat database into .mdb

Posted on 1998-10-12
10
8,814 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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