Connect to MS Access

General discussion forum about all databases other than SqlBase.
matelix

Connect to MS Access

Post by matelix » 02 Sep 2012, 22:25

Hi All

I need to connect to an MS Access database via TD 5.2, I'm looking for something similar to the VB jet engine or ADO connection. Does TD have anything like this?

Thanks in advance

Jeff Luther

Re: Connect to MS Access

Post by Jeff Luther » 04 Sep 2012, 18:17

Connection is likely via ODBC.

matelix

Re: Connect to MS Access

Post by matelix » 06 Sep 2012, 14:50

I feared that might be the case. Can i at least automate the ODBC connection? I don't want the user to go fiddling with these settings for themselves

Thanks Jeff

gigit
Italy
Posts: 166
Joined: 14 Jun 2017, 15:04
Location: Italy

Re: Connect to MS Access

Post by gigit » 06 Sep 2012, 16:15

Hi, Matelic.
You only need and entry in your SQL.INI like this.
No DSN is required, only drivers installed.
Or, of course, you can build the connection string into the application.


[win32client.dll]
; ------------------------- DLL per odbc
comdll=sqlodb32

; Connection strings
; ACCESS

REMOTEDBNAME=AGEPRO,Driver=Microsoft Access Driver (*.mdb);Dbq=G:\database\access\agepro.mdb;MaxBufferSize=2048;PageTimeout=5;UID=admin;

;SQLSERVER
REMOTEDBNAME=WIGWAM,Driver=Sql Server;Server=GIGI01\SQL2008R2;Database=WIGWAM;LastUser=sa;UseProcForPrepare=0;AnsiNPW=No;QuotedId=No;AutoTranslate=No;Language=English

Jeff Luther

Re: Connect to MS Access

Post by Jeff Luther » 06 Sep 2012, 22:54

gigit is correct about the TD SQL.INI setting, but just to be sure you are clear: if will not work if [win32client.dll] section only has the comdll= entry for ODBC. This is correct -- and I will keep the comment that's in the default INI file on install:

[win32client.dll]
; order of win32client dll's is important when connecting to multiple databases.
; sqlws32 should always be the last and sqlodb32 be 2nd last.
; comdll=sqlifx32
; comdll=sqlora32
; comdll=sqlsyb32
comdll=sqlodb32
comdll=sqlws32

I've put in bold the fact that sqlodb32 is second to last, and even if you do not connect to SQLBase, that last entry must be there: comdll=sqlws32
Reason? That enables TD internally to call common/general SQL/API functions that are needed for any DB connectivity.

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 1 guest