cyberbiker
Programmer
I am almost through with a pretty major database program (Access97). The help, (direct and indirect) from these forums have made it possible for me to do this, since I have been learning database programming as I went.
At this point, the program works quite well and everyone is more or less pleased (the main man is quite pleased which is what counts I guess), but I have one more thing I need to improve upon, which is to repair and compact the database.
The following code works well, but I do not like hardcoding paths.
Private Sub cmdCompact_Click()
DBEngine.RepairDatabase "c:\my documents\aaaa\testbe.mdb"
DBEngine.CompactDatabase "c:\my documents\aaaa\testbe.mdb", "c:\my documents\aaaa\Newdb.mdb"
Kill "c:\my documents\aaaa\testbe.mdb"
Name "c:\my documents\aaaa\Newdb.mdb" As "c:\my documents\aaaa\testbe.mdb"
End Sub
In actual practice the backend will be on the server not my c drive.
I used the linked table manager to link to the backend.
Is there a logical way for me to improve this code?
Perhaps a way to read the path from the linked table manager? Or any other ideas?
Thanks Terry (cyberbiker)
At this point, the program works quite well and everyone is more or less pleased (the main man is quite pleased which is what counts I guess), but I have one more thing I need to improve upon, which is to repair and compact the database.
The following code works well, but I do not like hardcoding paths.
Private Sub cmdCompact_Click()
DBEngine.RepairDatabase "c:\my documents\aaaa\testbe.mdb"
DBEngine.CompactDatabase "c:\my documents\aaaa\testbe.mdb", "c:\my documents\aaaa\Newdb.mdb"
Kill "c:\my documents\aaaa\testbe.mdb"
Name "c:\my documents\aaaa\Newdb.mdb" As "c:\my documents\aaaa\testbe.mdb"
End Sub
In actual practice the backend will be on the server not my c drive.
I used the linked table manager to link to the backend.
Is there a logical way for me to improve this code?
Perhaps a way to read the path from the linked table manager? Or any other ideas?
Thanks Terry (cyberbiker)