DBGateway_Connect

4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next

version 2004


DBGateway_Connect (host; connStr) Longint

ParameterTypeDescription
hostStringDNS Server name or IP Number
connStrStringADO connection string
Function resultLongintConnection ID that is used by other calls

Description

The DBGateway_Connect command returns a Longint containing the connection ID used by other calls. The address passed to the function for the server location supports both DNS names,

as well as numeric (x.x.x.x) IP addresses.

host is a String containing the DNS server name or IP number.

connStr is an ADO connection string that contains the details necessary to select

and connect to the database. If you're accessing your database via ODBC, you can set up

a system DSN in the ODBC control panel, and use a connection string of:

"Provider=MSDASQL;DSN=DSNName".

If you want to connect to a specific Jet database file, and you don't want to set up a DSN, then use:

"Provider=MSDASQL;Driver={Microsoft Access Driver (*.mdb)}; DBQ=c:\home\biblio.mdb".

Using ADO means many ways to connect to many data sources (including Windows services, RDBMS, etc.) but determining the right "Connect String" (depending on the target data source and the driver used) can be tricky. Here is a link to a website that centralizes ADO compliants concerning "Connect Strings":

http://www.carlprothman.net/Default.aspx?tabid=81


4D - Documentation   Français   English   German   4D For ADO, Command Theme List   4D For ADO, Command Alphabetical List   Back   Previous   Next