Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Here's a wierd one...(DAO TableDef, Refreshlink, strange error)

Status
Not open for further replies.

BobRodes

Instructor
May 28, 2003
4,215
US
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
 
Thanks for the links, CCLINT. They're worth keeping for general information. I was able to avoid this problem by moving around some proc calls, still not quite sure why. But it seems that the connect isn't the issue, since it works now. I guess it's just another phantom thing...

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top