Charlotte Foust
cfoust at infostatsystems.com
Thu Apr 10 16:21:31 CDT 2003
All you have to do is create the table and set its connect string and sourcetable name, then append it to the TableDefs collection. You don't set attributes. Charlotte Foust -----Original Message----- From: Don Elliker [mailto:delliker at hotmail.com] Sent: Thursday, April 10, 2003 9:04 AM To: accessd at databaseadvisors.com Subject: [AccessD] Linking to various dbs through DAO /Access2k I am trying to get linked to a selected database through code. I get a failure on the append. The very informative 3251 "Operation is not supported for this type of object". I need to delete all the attached tables and relink to new ones. I am doing this: db_Be is the new database I want to link to. dbcur is the front end I am running code from. Thanks, and How's everybody been?(don't answer that you'll kill my hotmail account) _D For intI = 0 To db_BE.TableDefs.Count - 1 Set TdfBE = db_BE.TableDefs(intI) SysCmd acSysCmdUpdateMeter, intI If Not TdfBE.Name Like "msys*" Then Set tdfNew = dbCur.CreateTableDef() With tdfNew .Name = "newtable" & intI '.Attribu! tes = dbAttachedTable .SourceTableName = TdfBE.Name .Connect = "MS Access;DATABASE=" & strDBName End With 'dbCur.TableDefs.Append (tdfNew) dbCur.TableDefs.Append (tdfNew) ! End If Next intI _____ Tired of spam? Get advanced junk mail protection <http://g.msn.com/8HMJENUS/2734> with MSN 8. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030410/995df7df/attachment-0001.html>