|
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;Persist Security Info=False;Extended Properties=""DSN=Visual FoxPro Tables;UID=;SourceDB=E:\CHECKS.DBF;SourceType=DBF;Exclusive=No; BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=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;Persist Security Info=False;Extended Properties=""DSN=Visual FoxPro Tables;UID=;SourceDB=E:\CHECKS.DBF;SourceType=DBF;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;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 ?
|
|
|
|