icemanmt78
Jul 4th, 2000, 11:23 AM
I have been having probs linking a table from one database to another. I am aiming to link the table "Traffic" from the source.mdb to the dest.mdb. I am getting a RTE 3125 when i run the code. The rte refers to "The database engine can't find ". Make sure it is a valid parameter or alias name, that it doesn't include invalid characters or punctuation etc etc
The RTE is pointing to the last line of code
Any ideas, i am stuck!!!!
Here is the code
Sub Main()
Dim dbsSource As Database
Dim dbsDest As Database
Dim daotdflink As TableDef
Dim sLinkHeader As String
sLinkHeader = ";DATABASE="
Set dbsDest = OpenDatabase("C:\windows\desktop\dest.mdb")
MsgBox ("hello")
Set daotdflink = dbsDest.CreateTableDef(traffic)
daotdflink.Connect = sLinkHeader & "C:\windows\desktop\source.mdb"
daotdflink.SourceTableName = traffic
dbsDest.TableDefs.Append daotdflink
End Sub
The RTE is pointing to the last line of code
Any ideas, i am stuck!!!!
Here is the code
Sub Main()
Dim dbsSource As Database
Dim dbsDest As Database
Dim daotdflink As TableDef
Dim sLinkHeader As String
sLinkHeader = ";DATABASE="
Set dbsDest = OpenDatabase("C:\windows\desktop\dest.mdb")
MsgBox ("hello")
Set daotdflink = dbsDest.CreateTableDef(traffic)
daotdflink.Connect = sLinkHeader & "C:\windows\desktop\source.mdb"
daotdflink.SourceTableName = traffic
dbsDest.TableDefs.Append daotdflink
End Sub