Quote:
Originally Posted by Lysander
I have done this so many times, but now forgotten how I did it.
I need to programaticaly change the backend database, i.e. add tables, relationships, fields etc. (This is because the live system, that needs changing, is in West Africa, I am in London)
I remember all about ALTER TABLE and CREATE TABLE etc, but I can't seem to attach to the back end database from my code database
dim db as database
set db="Z:\bissau\bissaudata.mdb"
gives me a Type Mismatch on compile.
I've search this forum, gone through my old code and even looked in some manuals but can't find the solution.
TIA
Hi,
open a workspace first and
Set db=workspace.opendatabase([path])
extract path info from the connected table, remove the tabledef from your database and reconnect it:
Private Sub ConnectTable(SourceDb, tbl)
DoCmd.TransferDatabase acLink, "Microsoft Access", SourceDb, acTable, tbl, tbl, False
End Sub