Solved

Access data files of type 2000 05 13 0000 (Wide).dbf in VB 5.0 Application

Posted on 2001-06-13
4
179 Views
Last Modified: 2010-05-02
How to Access data files of type
2000 05 13 0000 (Wide).dbf in VB 5.0 Application ? How to access & import data from a No. of dbf files of type 2000 05 13 0000 (Wide).dbf stored in a directory
ie.
d:\datalog to MS Access (MDB) Database in Visual Basic 5.0 ?

0
Comment
Question by:Mahesh
4 Comments
 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6189770
It appears to be a foxpro/dbase file. You could attach the table, by clicking link tables from MS Access, on Tables tab.

Select "Files of type": dbase III, dbase IV, dbase 5 or Microsoft Foxpro, as the case may be. Yours could work atleast in either one of these.

Try doing like this to work with. Or else, you could also import data to Access table, and work upon.
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 100 total points
ID: 6189986
Alternatively you could use an ADO or DAO connection to the dbf file without going through access. Using ADO is extremely easy as you only need to set a connection string such as cnnADOConnection.ConnectionString = "Provider=MSDASQL.1;Extended Properties=Driver={Microsoft Visual FoxPro Driver};UID=;PWD=;SourceDB=\\ServerName\Sharename\FolderName;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"

Set the SourceDB parameter to the path of the required file, you can then treat the dbf file as a table in the normal way:

Dim cnnADOConnection As ADODB.Connection
Dim rstDBF As ADODB.Recordset
Set cnnADOConnection = New ADODB.Connection
Set rstDBF = New ADODB.Recordset
cnnADOConnection.ConnectionString = "Provider=MSDASQL.1;Extended Properties=Driver={Microsoft Visual FoxPro Driver};UID=;PWD=;SourceDB=\\ServerName\Sharename\FolderName;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;"
cnnADOConnection.Open
rstDBF.Open "Select * From '2000 05 13 0000 (Wide).dbf'",cnnADOConnection,adOpenStatic,adLockOptimistic
With rstDBF
 'Manipulate the recordset
End With
rstDBF.Close
cnnADOConnection.Close
Set rstDBF = Nothing
Set cnnADOConnection = Nothing
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7136086
Hi Mahesh@devx,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will suggest to:

    Accept TimCottee's comment(s) as an answer.

Mahesh@devx, if you think your question was not answered at all or if you need help, you can simply post a new comment here.  Community Support moderators will follow up.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
==========
DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 7168366
Comment from expert accepted as answer

Computer101
E-E Moderator
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…

803 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