Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Link foxpro table using code 1

Status
Not open for further replies.

LaDeana1

Programmer
Mar 22, 2002
13
0
0
US
I have some old foxpro 2.6 tables which need to be linked to my access db in code.

I have an ado connection string which works for me to access the tables:

"Provider=vfpoledb;" & "Data Source=W:\testf;" & _
"Mode=ReadWrite|Share Deny None; Collating Sequence=Machine; Password=''"


Can I use this string to link the foxpro tables into the database?

Here is the code I am using now to link them using the dbaseIV

___________________________________________________
Function LinkdBaseFile(strPath As String, _
strLinkPro As String, strRemTab As String)

Dim conn As New ADODB.Connection
Dim cat As New ADOX.Catalog
Dim tbl As New ADOX.Table

' Open the catalog using the current Access database.
cat.ActiveConnection = CurrentProject.Connection

' Create the new table.
tbl.Name = strRemTab
Set tbl.ParentCatalog = cat

' Set the properties to create the link.
tbl.Properties("Jet OLEDB:Create Link") = True
tbl.Properties("Jet OLEDB:Link Datasource") = "W:\testf"
tbl.Properties("Jet OLEDB:Link Provider String") = "Dbase IV;Null=No;Deleted=No;"
tbl.Properties("Jet OLEDB:Remote Table Name") = "Test"
' Append the table to the tables collection of the catalog.
cat.Tables.Append tbl

' Clean up.
Set cat = Nothing

End Function
_________________________________________
I have tried replacing the link provider string with my connection string but it doesn't work.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top