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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an ODBC linked table using VBA

Status
Not open for further replies.

vaneujl

MIS
Oct 11, 2001
10
BE
In some MS Access 97 applications I developped in the past I was using a VBA code to create a ODBC linked table.
Here is the MS Access97 code.

Dim tdfLinked As TableDef
Dim ConnectString as String

ConnectString = "ODBC;DSN=B5P2;DBALIAS=B5P2;UID=MyLogon;PWD=MyPswd;TABLE=AB5BL001.MPR2"

Set tdfLinked = CurrentDb.CreateTableDef("MPRdb")
tdfLinked.Connect = ConnectString
tdfLinked.SourceTableName = "AB5BL001.MPR2"
tdfLinked.Attributes = dbAttachSavePWD
CurrentDb.TableDefs.Append tdfLinked

We are now migrating to MS Access2000. So, the code here above is not more working.

Is somebody can help me converting that code in MS Access2000?

Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top