I'm working with a labyrinthine piece of code. There's an Access .mdb file that consists of linked tables into an SQL Server db. It all works fine, except in one case. I'm trying to initialize the Connect property of each table during the initial install of the product. There's a security context in the default workspace, and SystemDB is set to an .mdw file. Now, when I do the following code
dao.dbengine.systemdb = [valid .mdw file name from registry]
set ws = dbengine.createworkspace("temp", myname, mypwd, dbUseJet)
dbname = [valid .mdb file name from registry, with linked tables]
set db = ws.opendatabase(dbname)
for each td in db.tabledefs
if (td.attributes and dbattachedodbc) then 'i. e. if table is a linked table
td.connect = "ODBC;Description=(etc.);driver=SQL Server;server=myservername;database=mysqlserverdb"
td.refreshlink
end if
next
when the code hits td.refreshlink I get a weird error:
Run time error '3000':
Reserved error(-7778; there is no message for this error.)
I've done this from a freshly booted machine, with nothing but the vb project and the test project open previously.
Can anyone out there help? I'm mystified.
Thanks,
Bob Rodes
dao.dbengine.systemdb = [valid .mdw file name from registry]
set ws = dbengine.createworkspace("temp", myname, mypwd, dbUseJet)
dbname = [valid .mdb file name from registry, with linked tables]
set db = ws.opendatabase(dbname)
for each td in db.tabledefs
if (td.attributes and dbattachedodbc) then 'i. e. if table is a linked table
td.connect = "ODBC;Description=(etc.);driver=SQL Server;server=myservername;database=mysqlserverdb"
td.refreshlink
end if
next
when the code hits td.refreshlink I get a weird error:
Run time error '3000':
Reserved error(-7778; there is no message for this error.)
I've done this from a freshly booted machine, with nothing but the vb project and the test project open previously.
Can anyone out there help? I'm mystified.
Thanks,
Bob Rodes