Access 2007: ODBCDirect is no longer supported. Rewrite the code

P

PSoltis

I just started using Access 2007 and my database that loads a form
automatically and logs users directly into a database, no longer works. I
get the following error:
ODBCDirect is no longer supported. Rewrite the code to use ADO instead of
DAO.

Below is the code, but I do not know how to begin making this change to ADO
so it will work. Any help would be appreciated.

' perform an automatic connection to the database...no password required
Set wrkODBC = CreateWorkspace("FAMISODBC", "Admin", "Admin",
dbUseODBC)
Set dbsODBC = CurrentDb
On Error GoTo Err_Form_Load_FAMIS_Delete
dbsODBC.TableDefs.Delete ("CONNECT_TO_FAMIS")

Continue_FAMIS_Connection:
On Error GoTo Err_Form_Load_FAMIS
Set tblDefinition = dbsODBC.CreateTableDef("CONNECT_TO_FAMIS")
tblDefinition.Connect = "ODBC;DSN=FAMIS PRODUCTION
92;DBQ=HOSTPROD.WORLD;UID=REPORTS999;PWD=PSS199;DBA=R;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=T;MTS=F;CSR=F;PFC=10;TLO=0;"
tblDefinition.SourceTableName = "FAMIS.FAMIS_CRAFT"
dbsODBC.TableDefs.Append tblDefinition
On Error GoTo Err_Form_Load
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top