Hi,
I am new to this group. I have searched high and low for an answer to what I'm sure is a very simple question.
Why when I run the code below does my database grow from about 800Kb to 50Mb and will not shrink even with compact and repair. The moment I switch this function off and use the linked table manager, it does not grow.
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
'Dim tdf1 As DAO.TableDef
'Dim Newserver As String
Dim tdfproperties As String
'Dim Position As String
Set dbs = CurrentDb()
' Loop through TableDefs collection, only processing
' the table if it already has a Connection property.
' (all other tables are local ... not linked.)
' In other words this will only change linked tables.
For Each tdf In dbs.TableDefs
tdfproperties = tdf.Connect
If InStr(tdfproperties, "efacdb") > 0 Then
tdf.Connect = "ODBC;Driver=SQL SERVER;" & "server=svr-db;" & "Database=" & "efacdb;& " & "Trusted_Connection=no;" & "Uid=efacs;" & "pwd=Password1"
tdf.RefreshLink
End If
Next tdf
Set tdf = Nothing
Look forward to some guidance.
I am new to this group. I have searched high and low for an answer to what I'm sure is a very simple question.
Why when I run the code below does my database grow from about 800Kb to 50Mb and will not shrink even with compact and repair. The moment I switch this function off and use the linked table manager, it does not grow.
Dim dbs As DAO.Database
Dim tdf As DAO.TableDef
'Dim tdf1 As DAO.TableDef
'Dim Newserver As String
Dim tdfproperties As String
'Dim Position As String
Set dbs = CurrentDb()
' Loop through TableDefs collection, only processing
' the table if it already has a Connection property.
' (all other tables are local ... not linked.)
' In other words this will only change linked tables.
For Each tdf In dbs.TableDefs
tdfproperties = tdf.Connect
If InStr(tdfproperties, "efacdb") > 0 Then
tdf.Connect = "ODBC;Driver=SQL SERVER;" & "server=svr-db;" & "Database=" & "efacdb;& " & "Trusted_Connection=no;" & "Uid=efacs;" & "pwd=Password1"
tdf.RefreshLink
End If
Next tdf
Set tdf = Nothing
Look forward to some guidance.