Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relink to dbase File 1

Status
Not open for further replies.

vich

Technical User
Sep 26, 2000
107
US
I am trying to relink to a dabase file on another drive using the following code an get an error stating that the file does not exist, which it does. I know I am overlooking something obvious. Help would be appreciated very much.

Thanks

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim tbl As TableDef
Set db = CurrentDb()
Set tbl = db.TableDefs("CELabels")
tbl.Connect = "Dbase IV;DATABASE=V:\FMS\CELabels.dbf"
tbl.RefreshLink
 
When connecting to DBase, you use the directory in which the tables reside as the 'database'. The table name is added to SourceTableName.

Code:
   Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Dim tbl As TableDef
    Set db = CurrentDb()
    Set tbl = db.TableDefs("CELabels")
    tbl.Connect = "Dbase IV;DATABASE=V:\FMS"
    tbl.SourceTableName = "CELabels.dbf"
    tbl.RefreshLink

You may wish to use: HDR=NO;IMEX=2; in your connect string.
 
Perfect!

Thanks VERY much for the help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top