Re: Changing ODBC Connect settings in MS ACCESS linked table property



Hello dpc,
"dpc" <dpc@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

d> In the past I could fool the system and reset the linked table
d> properties by modifying the property for a particular row and then
d> saving the application. Although it would not allow me to change the
d> property at the table property level.
d> |...snip...|
d> This was working fine in the old versions where i had just ODBC and
d> the DSN; I tried resetting the connect string in the refreshLink
d> method but it does not reset the Link Table for some reason. Is
d> there antoher method I have to call first.

I would recommend always recreate TableDef when relinking to an ODBC data
source like the following:

strTmp = Format(Now(), "MMDDYY-hhmmss")
'' Rename existing tdf
dbs.TableDefs(!TableName).Name = !TableName & strTmp
dbs.TableDefs.Refresh
Set tdf = mdbs.CreateTableDef(!TableName, dbAttachSavePWD,
!TableName, strConnect)
dbs.TableDefs.Append tdf
'' Delete renamed tdf
DoCmd.DeleteObject acTable, !TableName & strTmp
dbs.TableDefs.Refresh

--
Sincerely,
Dmitriy Ivanov
Common Lisp ODBC interface - www.ystok.ru


.