Here is the code you need to link to the DBF file.
Option Compare Database
Option Explicit
Function ConnectSource()
Dim db As Database
Dim myDataPath As String
Dim myDBF As String
Dim myNewDBF As String
Set db = CurrentDb
' get the path to the DBF file - here I just typed it in
myDataPath = "C:\Access 2000\Projects\Test"
' here is the name of the DBF file
myDBF = "ACCESS.DBF"
' the new name it will use to id the file - may be the same as myDBF
myNewDBF = "MyDBFfile"
Exit Function
oops_err:
If Err.Number = 3265 Then Resume Next
MsgBox Err.Description, vbCritical
End Function
Function ConnectOutput(dbsTemp As Database, _
strTable As String, strConnect As String, _
strSourceTable As String)
Dim tdfLinked As TableDef
Dim rstLinked As Recordset
Dim intTemp As Integer
' Create a new TableDef, set its Connect and
' SourceTableName properties based on the passed
' arguments, and append it to the TableDefs collection.
Set tdfLinked = dbsTemp.CreateTableDef(strTable)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.