S
Susan
I have a database that is split into a front end and a
back end. In certain instances, I want to copy both the
front end and the back end so that they may be used
independently of the REAL database that is on a network
drive. When I perform the copy, the tables in the front
end are still linked to the back end on the network drive
as expected. I want to programmatically change this so
that they are linked to the back end file on the local
drive.
I have the following code that I thought would work, but
I'm having no luck.
Dim DB as DAO.Database
Set DB = OpenDatabase(FrontEndDatabase)
For I = 0 To DB.TableDefs.Count - 1
If DB.TableDefs(I).Connect <> "" Then
DB.TableDefs(I).Connect = _
";DATABASE=" & NewBackEndDatabase
End If
Next I
DB.Close
Set DB = Nothing
I have tried various connect strings, but none have
worked. When I look in the debugger, the current string
has the format as above. When I execute this code, the
debugger shows that the connect string has changed. But
when I subsequently open the Access database, the tables
are still linked to the back end on the network.
Any suggestions?
Susan
back end. In certain instances, I want to copy both the
front end and the back end so that they may be used
independently of the REAL database that is on a network
drive. When I perform the copy, the tables in the front
end are still linked to the back end on the network drive
as expected. I want to programmatically change this so
that they are linked to the back end file on the local
drive.
I have the following code that I thought would work, but
I'm having no luck.
Dim DB as DAO.Database
Set DB = OpenDatabase(FrontEndDatabase)
For I = 0 To DB.TableDefs.Count - 1
If DB.TableDefs(I).Connect <> "" Then
DB.TableDefs(I).Connect = _
";DATABASE=" & NewBackEndDatabase
End If
Next I
DB.Close
Set DB = Nothing
I have tried various connect strings, but none have
worked. When I look in the debugger, the current string
has the format as above. When I execute this code, the
debugger shows that the connect string has changed. But
when I subsequently open the Access database, the tables
are still linked to the back end on the network.
Any suggestions?
Susan