<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2>Maybe the post lost something. All I saw was an Attached attribute,
not AttachSavePwd. I don't use password protected dbs, so I can't help you
there. Here's a routine from my libraries that works to create a single
link. I've removed the error handling, etc., for clarity, but maybe this
will help you get a handle on the problem.</FONT></SPAN></DIV>
<DIV><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2>Private Function LinkTable(ByVal strTblName As String,
_<BR>
ByVal strTblAlias As String,
_<BR>
ByVal strConnect As String)<BR> Dim dbs As DAO.Database<BR> Dim tdf
As DAO.TableDef<BR> <BR> Set dbs = CurrentDb()<BR> Set
tdf = dbs.CreateTableDef(strTblAlias)<BR> With tdf<BR>
.Connect = strConnect<BR> .SourceTableName =
strTblName<BR> End With<BR> dbs.TableDefs.Append tdf<BR> Set
tdf = Nothing<BR> Set dbs = Nothing<BR>ProcExit:<BR> Exit
Function</FONT></DIV>
<DIV>
<P><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2>End Function</FONT></SPAN></P>
<P><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2></FONT></SPAN> </P>
<P><SPAN class=607575516-11042003><FONT face="Comic Sans MS" color=#0000ff
size=2>Charlotte Foust</FONT></SPAN></P></SPAN></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Don Elliker
[mailto:delliker@hotmail.com] <BR><B>Sent:</B> Friday, April 11, 2003 8:17
AM<BR><B>To:</B> accessd@databaseadvisors.com<BR><B>Subject:</B> RE: [AccessD]
Linking to various dbs through DAO /Access2k<BR><BR></FONT></DIV>
<DIV>
<DIV>
<P>I have a front end which needs to attach to various BEs, depending on the
users requirement. The BE may or may not have the same tables - so I cannot
just reset the connect and refreshlink (I want all the tables, regardless)
The database is also pword protected (not secured) so I want to save the
password (hence the Attribute dbAttachSavePwd- the latest one I'm using - if I
don't need it , great! less work for mother). It does not like the append to
the tabledefs collection when the table is new.<BR>There are further strange
things I have come across - it seems that if the tabledef is 'nothing' you can
still append it! It mysteriously replaces an existing tabledef (probably
ordinally)-so that what it's named is not what it is. -don't think about it
too much - it hurts. I WILL solve this - any clues or thought gratefully
accepted</P>
<P>_d</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 08:24:28 -0700
<DIV></DIV>>
<DIV></DIV>>You don't need to set an attached attribute if you create a
link.
<DIV></DIV>>Access already knows it's attached. I don't understand what
you're
<DIV></DIV>>doing. Is this the same BE you were already using or a
different one?
<DIV></DIV>>Usually dropping and recreating a link is because you've
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
/Access2k
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>>
<DIV></DIV>> ok-tried that (it's commented) you can set the attributes if
you
<DIV></DIV>>want btw. still fails on the append. I have some thoughts I
will try
<DIV></DIV>>today and will advise. There's a cryptic note in the help about
the
<DIV></DIV>>tables being appended when the Be is opened. I am doing a
delete of
<DIV></DIV>>tabledefs prior to the attempt to append , that may be causing
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>>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
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
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>><HTTP: 8HMEENUS g.msn.com 2734> 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><BR clear=all>
<HR>
Help STOP SPAM with <A href="http://g.msn.com/8HMDENUS/2731">the new MSN 8
</A>and get 2 months FREE* </BLOCKQUOTE></BODY></HTML>