[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Convert .dat database into .mdb

Posted on 1998-10-12
10
Medium Priority
?
8,983 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
Technology Partners: 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 300 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses

649 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