ODBC Connection

orna

Registered User.
Local time
Today, 13:24
Joined
Oct 13, 2002
Messages
78
Hi

I used to link Oracle table manualy to Access DB, but somtimes the table becomes read only when the app is moved to another PC, so I want to refresh the link through code evry time the user open the app.

My string connection :

strConn = "ODBC;DSN=test;PWD=MyPass;DBA=W;"

if the table is't linked:

Set tbl = db.CreateTableDef(strTblName, dbAttachSavePWD, strTblName, strConn)
db.TableDefs.Append tbl

else:

Set tbl = db.TableDefs(strTblName)
tbl.Connect = strConn
tbl.RefreshLink

In both cases, the table is not updatable but when link manualy with the same DNS - it is.
How can I link/RefreshLink and get an updatable table??

Thanks in advance
 
Last edited:
Access requires ODBC table to have a unique index in order to be updateable. When you manually link to the table are you getting a dialog form where Access is asking you to choose a key field?
 
Hi Pat

Thank you for replying

I acually got the dialog to choose a key, but the reason is that
the DB is a test Db and there wasn't any key field defiend.
When I define a key, the table is updatable no matter how I connect it and it suitms me.
 

Users who are viewing this thread

Back
Top Bottom