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
Terminal Server - Outlook configures automatically when users login
SQL Express 2005 ODBC Connection Error 67 and 17
VBA - Playing Movies using VLC or GOM Player
Want to open form when file opens, but getting file/access error 75 message
Exchange 2007 to 2010 upgrade
Getting Microsoft.Win32.RegistryKe<wbr />y from PROFILEINFO.hProfile - from PInvoke to .Net
Registry cannot load the hive.
convert delimited text file into 2 dimension array
CREATE AN MSDOS BOOT CD FOR ACRONIS, KNOPPIX, GHOST, WINDOWS XP REPAIR CONSOLE!
trouble with displaying recordset results in datasheet view