<br><font size=2 face="sans-serif">or you can you can use your code and do the following:</font>
<br>
<br><font size=2 face="Courier New">Do Until rsData.EOF = True<br>
</font><font size=2><tt>DoCmd.TransferDatabase acLink, "Microsoft Access", mylocation & myfile, acTable, mytable, mytable</tt></font><font size=2 face="Courier New"><br>
rsData.MoveNext</font>
<br><font size=2 face="Courier New">Loop</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>"Christopher Hawkins" <clh@christopherhawkins.com></b></font>
<br><font size=1 face="sans-serif">Sent by: accessd-bounces@databaseadvisors.com</font>
<p><font size=1 face="sans-serif">06/05/2003 02:06 PM</font>
<br><font size=1 face="sans-serif">Please respond to accessd</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: accessd@databaseadvisors.com</font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: [AccessD] Fast back-end relinking?</font></table>
<br>
<br>
<br><font size=2 face="Courier New">First off: I have seen (and used) Tribble's Back-End relinker<br>
before. That's not what I need in this case.<br>
<br>
I have inherited an app with some back-end relinking code that is<br>
very slow. I've seen programmatic implementations of a table link<br>
that linked up very quickly, as quickly as using File > Get External<br>
Data > Link Tables. The one I'm dealing with takes many times as<br>
long.<br>
<br>
There is a table in my db called tblTable. It contains the name and<br>
path of every table in the database. The table is used in the<br>
following code:<br>
<br>
***START***<br>
<br>
Dim db As DAO.Database<br>
Dim tbl As DAO.TableDef<br>
Set db = CurrentDb<br>
Dim rsData As DAO.Recordset<br>
<br>
<br>
Set rsData = db.OpenRecordset("SELECT * FROM tblTable")<br>
<br>
rsData.MoveFirst<br>
<br>
Do Until rsData.EOF = True<br>
Set tbl = db.CreateTableDef(rsData("TableName"))<br>
Debug.Print "Now attaching " & tbl.Name & "..."<br>
tbl.Connect = (";DATABASE=" & rsData("Path"))<br>
tbl.SourceTableName = rsData("TableName")<br>
db.TableDefs.Append tbl<br>
rsData.MoveNext<br>
Loop<br>
<br>
db.Close<br>
<br>
***END***<br>
<br>
All the lag takes place when running the 'db.TableDefs.append tbl'<br>
line.<br>
<br>
Is there any way to speed this process up? I've seen it done more<br>
quickly before, I just didn't get to see the actual code. :(<br>
<br>
-Christopher-<br>
<br>
_______________________________________________<br>
AccessD mailing list<br>
AccessD@databaseadvisors.com<br>
http://databaseadvisors.com/mailman/listinfo/accessd<br>
Website: http://www.databaseadvisors.com<br>
<br>
</font>
<br>
<br>