<html><div style='background-color:'><DIV>
<P>THANK YOU Very much! It was the Parens on the tabledef - of all the stupid crap!! I just noticed you did not have parens and VIOLA mine works now! I love those meaningful error messages. And now that I think of it, I have been bit by that before - though not in a while. When it doesn't return anything---NO PARENS....thanks again.<BR>(I did say I changed the attribute ...btw*-)</P>
<P>_D<BR></P></DIV>
<DIV></DIV>
<DIV></DIV>>From: "Charlotte Foust" <CFOUST@INFOSTATSYSTEMS.COM>
<DIV></DIV>>Reply-To: accessd@databaseadvisors.com
<DIV></DIV>>To: <ACCESSD@DATABASEADVISORS.COM>
<DIV></DIV>>Subject: RE: [AccessD] Linking to various dbs through DAO /Access2k
<DIV></DIV>>Date: Fri, 11 Apr 2003 10:09:28 -0700
<DIV></DIV>>
<DIV></DIV>>Maybe the post lost something. All I saw was an Attached attribute, not
<DIV></DIV>>AttachSavePwd. I don't use password protected dbs, so I can't help you
<DIV></DIV>>there. Here's a routine from my libraries that works to create a single
<DIV></DIV>>link. I've removed the error handling, etc., for clarity, but maybe
<DIV></DIV>>this will help you get a handle on the problem.
<DIV></DIV>>
<DIV></DIV>>Private Function LinkTable(ByVal strTblName As String, _
<DIV></DIV>> ByVal strTblAlias As String, _
<DIV></DIV>> ByVal strConnect As String)
<DIV></DIV>> Dim dbs As DAO.Database
<DIV></DIV>> Dim tdf As DAO.TableDef
<DIV></DIV>>
<DIV></DIV>> Set dbs = CurrentDb()
<DIV></DIV>> Set tdf = dbs.CreateTableDef(strTblAlias)
<DIV></DIV>> With tdf
<DIV></DIV>> .Connect = strConnect
<DIV></DIV>> .SourceTableName = strTblName
<DIV></DIV>> End With
<DIV></DIV>> dbs.TableDefs.Append tdf
<DIV></DIV>> Set tdf = Nothing
<DIV></DIV>> Set dbs = Nothing
<DIV></DIV>>ProcExit:
<DIV></DIV>> Exit Function
<DIV></DIV>>
<DIV></DIV>>End Function
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>Charlotte Foust
<DIV></DIV>>
<DIV></DIV>> -----Original Message-----
<DIV></DIV>> From: Don Elliker [mailto:delliker@hotmail.com]
<DIV></DIV>> Sent: Friday, April 11, 2003 8:17 AM
<DIV></DIV>> To: accessd@databaseadvisors.com
<DIV></DIV>> Subject: RE: [AccessD] Linking to various dbs through DAO
<DIV></DIV>>/Access2k
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> I have a front end which needs to attach to various BEs,
<DIV></DIV>>depending on the users requirement. The BE may or may not have the same
<DIV></DIV>>tables - so I cannot just reset the connect and refreshlink (I want all
<DIV></DIV>>the tables, regardless) The database is also pword protected (not
<DIV></DIV>>secured) so I want to save the password (hence the Attribute
<DIV></DIV>>dbAttachSavePwd- the latest one I'm using - if I don't need it , great!
<DIV></DIV>>less work for mother). It does not like the append to the tabledefs
<DIV></DIV>>collection when the table is new.
<DIV></DIV>> There are further strange things I have come across - it seems
<DIV></DIV>>that if the tabledef is 'nothing' you can still append it! It
<DIV></DIV>>mysteriously replaces an existing tabledef (probably ordinally)-so that
<DIV></DIV>>what it's named is not what it is. -don't think about it too much - it
<DIV></DIV>>hurts. I WILL solve this - any clues or thought gratefully accepted
<DIV></DIV>>
<DIV></DIV>> _d
<DIV></DIV>>
<DIV></DIV>> >From: "Charlotte Foust"
<DIV></DIV>> >Reply-To: accessd@databaseadvisors.com
<DIV></DIV>> >To:
<DIV></DIV>> >Subject: RE: [AccessD] Linking to various dbs through DAO
<DIV></DIV>>/Access2k
<DIV></DIV>> >Date: Fri, 11 Apr 2003 08:24:28 -0700
<DIV></DIV>> >
<DIV></DIV>> >You don't need to set an attached attribute if you create a
<DIV></DIV>>link.
<DIV></DIV>> >Access already knows it's attached. I don't understand what
<DIV></DIV>>you're
<DIV></DIV>> >doing. Is this the same BE you were already using or a
<DIV></DIV>>different one?
<DIV></DIV>> >Usually dropping and recreating a link is because you've
<DIV></DIV>>changed back
<DIV></DIV>> >ends but it sounds like you're doing something else.
<DIV></DIV>> >
<DIV></DIV>> >Charlotte Foust
<DIV></DIV>> >
<DIV></DIV>> >-----Original Message-----
<DIV></DIV>> >From: Don Elliker [mailto:delliker@hotmail.com]
<DIV></DIV>> >Sent: Friday, April 11, 2003 4:53 AM
<DIV></DIV>> >To: accessd@databaseadvisors.com
<DIV></DIV>> >Subject: RE: [AccessD] Linking to various dbs through DAO
<DIV></DIV>>/Access2k
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > ok-tried that (it's commented) you can set the attributes if
<DIV></DIV>>you
<DIV></DIV>> >want btw. still fails on the append. I have some thoughts I
<DIV></DIV>>will try
<DIV></DIV>> >today and will advise. There's a cryptic note in the help about
<DIV></DIV>>the
<DIV></DIV>> >tables being appended when the Be is opened. I am doing a
<DIV></DIV>>delete of
<DIV></DIV>> >tabledefs prior to the attempt to append , that may be causing
<DIV></DIV>>me a
<DIV></DIV>> >problem.
<DIV></DIV>> >
<DIV></DIV>> > _d
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> >
<DIV></DIV>> > >From: "Charlotte Foust"
<DIV></DIV>> > >Reply-To: accessd@databaseadvisors.com
<DIV></DIV>> > >To:
<DIV></DIV>> > >Subject: RE: [AccessD] Linking to various dbs through DAO
<DIV></DIV>> >/Access2k
<DIV></DIV>> > >Date: Thu, 10 Apr 2003 14:21:31 -0700
<DIV></DIV>> > >
<DIV></DIV>> > >All you have to do is create the table and set its connect
<DIV></DIV>> >string and
<DIV></DIV>> > >sourcetable name, then append it to the TableDefs collection.
<DIV></DIV>>
<DIV></DIV>> >You don't
<DIV></DIV>> > >set attributes.
<DIV></DIV>> > >
<DIV></DIV>> > >Charlotte Foust
<DIV></DIV>> > >
<DIV></DIV>> > > -----Original Message-----
<DIV></DIV>> > > From: Don Elliker [mailto:delliker@hotmail.com]
<DIV></DIV>> > > Sent: Thursday, April 10, 2003 9:04 AM
<DIV></DIV>> > > To: accessd@databaseadvisors.com
<DIV></DIV>> > > Subject: [AccessD] Linking to various dbs through DAO
<DIV></DIV>> >/Access2k
<DIV></DIV>> > >
<DIV></DIV>> > >
<DIV></DIV>> > >
<DIV></DIV>> > > I am trying to get linked to a selected database through
<DIV></DIV>>code.
<DIV></DIV>> >I
<DIV></DIV>> > >get a failure on the append. The very informative 3251
<DIV></DIV>> >"Operation is not
<DIV></DIV>> > >supported for this type of object". I need to delete all the
<DIV></DIV>> >attached
<DIV></DIV>> > >tables and relink to new ones.
<DIV></DIV>> > >
<DIV></DIV>> > > I am doing this: db_Be is the new database I want to link
<DIV></DIV>>to.
<DIV></DIV>> > >dbcur is the front end I am running code from.
<DIV></DIV>> > >
<DIV></DIV>> > > Thanks, and How's everybody been?(don't answer that you'll
<DIV></DIV>> >kill
<DIV></DIV>> > >my hotmail account)
<DIV></DIV>> > >
<DIV></DIV>> > > _D
<DIV></DIV>> > >
<DIV></DIV>> > > For intI = 0 To db_BE.TableDefs.Count - 1
<DIV></DIV>> > > Set TdfBE = db_BE.TableDefs(intI)
<DIV></DIV>> > > SysCmd acSysCmdUpdateMeter, intI
<DIV></DIV>> > > If Not TdfBE.Name Like "msys*" Then
<DIV></DIV>> > > Set tdfNew = dbCur.CreateTableDef()
<DIV></DIV>> > > With tdfNew
<DIV></DIV>> > > .Name = "newtable" & intI
<DIV></DIV>> > > '.Attribu! tes = dbAttachedTable
<DIV></DIV>> > > .SourceTableName = TdfBE.Name
<DIV></DIV>> > > .Connect = "MS Access;DATABASE=" &
<DIV></DIV>> > >strDBName
<DIV></DIV>> > > End With
<DIV></DIV>> > > 'dbCur.TableDefs.Append (tdfNew)
<DIV></DIV>> > >
<DIV></DIV>> > > dbCur.TableDefs.Append (tdfNew)
<DIV></DIV>> > > ! End If
<DIV></DIV>> > > Next intI
<DIV></DIV>> > >
<DIV></DIV>> > >
<DIV></DIV>> > >
<DIV></DIV>> > >
<DIV></DIV>> > > _____
<DIV></DIV>> > >
<DIV></DIV>> > > Tired of spam? Get advanced junk mail protection
<DIV></DIV>> > > with MSN 8.
<DIV></DIV>> > >
<DIV></DIV>> > >_______________________________________________
<DIV></DIV>> > >AccessD mailing list
<DIV></DIV>> > >AccessD@databaseadvisors.com
<DIV></DIV>> > >http://databaseadvisors.com/mailman/listinfo/accessd
<DIV></DIV>> > >Website: http://www.databaseadvisors.com
<DIV></DIV>> >
<DIV></DIV>> > _____
<DIV></DIV>> >
<DIV></DIV>> > Tired of spam? Get advanced junk mail protection
<DIV></DIV>> > with MSN 8.
<DIV></DIV>> >
<DIV></DIV>> >_______________________________________________
<DIV></DIV>> >AccessD mailing list
<DIV></DIV>> >AccessD@databaseadvisors.com
<DIV></DIV>> >http://databaseadvisors.com/mailman/listinfo/accessd
<DIV></DIV>> >Website: http://www.databaseadvisors.com
<DIV></DIV>>
<DIV></DIV>> _____
<DIV></DIV>>
<DIV></DIV>> Help STOP SPAM with the new MSN 8
<DIV></DIV>><HTTP: g.msn.com 2731 8HMDENUS> and get 2 months FREE*
<DIV></DIV>>
<DIV></DIV>>_______________________________________________
<DIV></DIV>>AccessD mailing list
<DIV></DIV>>AccessD@databaseadvisors.com
<DIV></DIV>>http://databaseadvisors.com/mailman/listinfo/accessd
<DIV></DIV>>Website: http://www.databaseadvisors.com
<DIV></DIV></div><br clear=all><hr>STOP MORE SPAM with <a href="http://g.msn.com/8HMDENUS/2728">the new MSN 8</a> and get 2 months FREE*</html>