Refresh Links 
Author Message
 Refresh Links

Using this code, how can I refresh the link of a csv file?

Set tdf = db.TableDefs(strTablename)
tdf.Connect = ";DATABASE=" & PathName
tdf.RefreshLink

I have a form that the user can type in a path and file name and then
refresh the links. This code works great for Access database tables. I tried
to change the code to refresh csv files but all I got was error messages.
I am using Access 97.

Thanks In Advance
Lou Civitella
Weber Systems, Inc.



Sat, 14 Jul 2001 03:00:00 GMT  
 Refresh Links
Hi Lou,

If I remember correctly, the name of the CSV file is actually stored in the
SourceTableName property of a tabledef object.  Along with setting the
Connect string, you'll probably have to update the SourceTableName property
as well.

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------


: Using this code, how can I refresh the link of a csv file?
:
: Set tdf = db.TableDefs(strTablename)
: tdf.Connect = ";DATABASE=" & PathName
: tdf.RefreshLink
:
: I have a form that the user can type in a path and file name and then
: refresh the links. This code works great for Access database tables. I
tried
: to change the code to refresh csv files but all I got was error messages.
: I am using Access 97.
:
: Thanks In Advance
: Lou Civitella
: Weber Systems, Inc.

:
:
:



Sat, 14 Jul 2001 03:00:00 GMT  
 Refresh Links
The connect strings for text files are a bit more complicated than for
linked Access (Jet) tables. The pattern you are using only applies to
Jet tables. Take a look at the existing connect string by bringing up
the table in design view and looking at its properties. In the
Description field you will see something like (all on one line):
Text;DSN=Delim Link
Specification;FMT=Delimited;HDR=NO;IMEX=2;DATABASE=C:\appdev\Acc1\Samples\Lab02;TABLE=Delim#txt

The above  would be a typical pattern for a link to a file called
Delim.txt, created with the wizard. The last part (Table=...) is the
SourceTableName that Dev referred to. The rest is the Connect property
value.

You may find it easier to delete the existing link and use
DoCmd.TransferText to create a new one.

 -- Andy

Quote:

>Using this code, how can I refresh the link of a csv file?

>Set tdf = db.TableDefs(strTablename)
>tdf.Connect = ";DATABASE=" & PathName
>tdf.RefreshLink

>I have a form that the user can type in a path and file name and then
>refresh the links. This code works great for Access database tables. I tried
>to change the code to refresh csv files but all I got was error messages.
>I am using Access 97.

>Thanks In Advance
>Lou Civitella
>Weber Systems, Inc.




Sun, 15 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Refresh Links

2. Refresh Link

3. Using VBA code to refresh links

4. refresh link in code or other method

5. Refreshing Link to Excel97 Spreadsheet with Code

6. 97 Dev Handbook refresh links problem

7. Refresh linked/imported tables programmatically

8. Refreshing links to data mdbs of unknown location 95

9. How to Refresh Links in a Run-Time Application

10. Refresh link of attach table

11. Refresh links in Access Database with VB 6.0 SP4

12. Refreshing linked tables in Access 2000

 

 
Powered by phpBB® Forum Software