Microsoft
Software
Hardware
Network
Question : How do i import data from Visual FoxPro 6.0 DB to Access 2003 with VBA
i'm trying to connect to a visual foxPro DB and a recordSet to it, but i haven't been able to do it, i've tried with both providers the ODBC and the OLEDB, here's the code so that you have a better idea :
*** START ***
Private Sub btnRetrievePay_Click()
Dim conn As ADODB.connection
Dim rsADO As ADODB.Recordset
Dim strConnect As String
Dim strSql As String
strSql = "SELECT * FROM checks"
' It is made sure that the check mark is selected for further process
If (CheckMark.Value = -1 And txtProvNum.Value <> "") Then
strConnect = "Provider=MSDASQL.1;Persis
t Security Info=False;Extended Properties=""DSN=Visual FoxPro Tables;UID=;SourceDB=E:\CH
ECKS.DBF;S
ourceType=
DBF;Exclus
ive=No;
BackgroundFetch=Yes;Collat
e=Machine;
Null=Yes;D
eleted=Yes
;"""
MsgBox strConnect
Set conn = New ADODB.connection
conn.Open strConnect
Set rsADO = New ADODB.Recordset
rsADO.Open strSql, conn, adOpenForwardOnly, adLockReadOnly
If rsADO.AbsolutePosition > -1 Then
MsgBox "Contains Records"
Else
MsgBox "Does not contain Records"
End If
Else
MsgBox "Please make sure the Check Box has been selected"
End If
End Sub
*** END ***
With this
connectString = "Provider=MSDASQL.1;Persis
t Security Info=False;Extended Properties=""DSN=Visual FoxPro Tables;UID=;SourceDB=E:\CH
ECKS.DBF;S
ourceType=
DBF;Exclus
ive=No;Bac
kgroundFet
ch=Yes;Col
late=Machi
ne;Null=Ye
s;Deleted=
Yes;"""
Tells me that the file checks.dbf, i'm assuming that doesn't work with visual FoxPro
--------------------------
----------
----------
----------
----------
----------
----------
----------
--------
With this
ConnectString= "Provider=vfpoledb;Data Source=E:\CHECKS.DBF"
Access Hangs and ShutDown giving me a Bug error if i want to send the error information to microsoft.
--------------------------
----------
----------
----------
----------
----------
----------
----------
--------
As you can see, what i'm trying to do its get a hold of the information in that table and be able to manipulate it as need to and retrieve it to a access Table, maybe you can tell me another way more easy to do this it will be of great help. Thank you in advance.
Answer : How do i import data from Visual FoxPro 6.0 DB to Access 2003 with VBA
what is the E drive {E:\CHECKS.DBF} a local drive or network shared ?
Random Solutions
Command button code
VBA Control (Box) Design Questions
Microsoft, Access, 2007, Prevent exclusive locking of linked table
How can i hide root level of TreeView in Silverlight?
Loan Calculator
Outlook Send option disabled
Attach Text Box and Combo Box text
Incrementing a field in a query
Install x86 print driver on an x64 print server
Cannot load TPSMain.exe as CpuPerf.dll not found