Re: [VW 7.3.1] ODBCConnection



Hi Charlie,

Well, there are differences for database connects. Each one uses different informations in its connect strings).

Postgres Connect using the PostgresEXDIConnection doesn't need a datasource (which is ODBC specific, not native postgres) nor does it need any database specific odbc drivers. You can directly connect to postgres using a socket connection which is not common for all database clients. Other databases use vendor specific database client dlls, as e.g. Oracle, Sybase, DB2, informix and others.

alternatively you can connect to postgres (or any other database that provides odbc drivers) using an odbc driver. then you are bound to the odbc protocol which should be a unifying standard across different database vendors. Communication then goes from vw via this driver to the database, not directly as above. odbc is a translation layer between the application that uses odbc and the vendor specific database protocol.

Normally you define an odbc data source for a connection to a whatever database. This name can then be used, because the odbc driver manager is then responsible for translation of this name to make a connection. It looks up all the settings and specifics defined for the data source, which includes what database type and driver is being used.

the need to define a datasource for odbc can be omitted if you provide all settings - that you make when defining a data source in the driver manager - in the connect string.

a possible connect to Informix via odbc without a data source is e.g.
"DRIVER={IBM INFORMIX 3.82 32 BIT};DB=ultimate;UID=whoever;PWD=secret;
SERVER=ol_serv1;HOST=serv1;SERVICE=turbo;PRO=onsoctcp;
TDLL=C:\Programme\Informix\Client-SDK\bin\igo4n304.dll;"

This defines all settings normally configured for a datasource. the name of the driver is that one that is displayed when choosing the database type in odbc.

in VW, the class ODBCConnection uses a different connection scheme if DRIVER={ is given in the connect string, using SQLDriverConnect instead of SQLConnect. (See method useDriverConnect: there)

Using MS SQLServer, it sould be DRIVER={SQL Server};DB=xxx;UID=......

Providing this as connect string for an odbc connection should connect directly to SQLserver without the need for a defined DSN.

We currently connect only to Informix (via ODBC driver) using this scheme, so I cannot provide any specifics for SQL Server, just that it should work as it does for Informix. We never define a DSN for our access to Informix, we just use the way described above.

Thomas

BTW: Even StroeForSQLServer should be able to connect using driverConnect without a defined DSN if the settings string is set up correctly.

Charlie Adams schrieb:
OK, I've browsed the vwnc mailing list archives and apparently that is just the way StoreForSQLServer works. You must declare a data source through Windows' ODBC Data Source Administrator. PostgreSQL opens a socket and converses directly. This must be the lone exception for Windows-based DB access.

What bothers me is that it was so difficult to divine.

"Charlie Adams" <c-adams@xxxxxxxxxxxxxxxxxxxx> wrote in message news:43302363$1@xxxxxxxxxxxxxxxxxxxxxxxxxx

In looking at PostgreSQLEXDIConnection, it would appear to do what I need. It takes an environment string, ex. 'hostName:port_dBName', and connects straight through to the machine -- no data source required.

Is it possible to achieve this behavior with an ODBCConnection? It seems to only work with data sources.

"Thomas Brodt" <thomas.brodt@xxxxxxxxxx> wrote in message news:432fc8cb$1@xxxxxxxxxxxxxxxxxxxxxxxxxx

AFAIK, the DRIVER must be given in {} and it must be first in the parameter string, so you should begin with 'DRIVER={don't know what SQL Server has to look like};UID=.....'.

You should also verify that in odbcconnection you use the path using the SQL*Driver*Connect call, not the regular SQLConnect which uses data source names.

HTH
Thomas

Charlie Adams schrieb:

In WinXP Pro and VW 7.3.1, it appears that I cannot create a valid ODBCConnection object without building an ODBC Data Source using the ODBC Data Source Administrator from Windows Admin Tools. Is that right?

I want to connect to my version 7.0 SQL Server directly and attach to a database there. But it seems I must build the interim data source object to get there. My customer chafes at this saying his Java program uses a connection string of the sort:

Driver=SQL Server;Server=myMachine;Database=SomeDBName;Uid=myUserID;Pwd=aPsswrd

and this negates the need to define a data source. I don't see the magic I need from the DatabaseAppDevGuide.pdf.





.



Relevant Pages

  • RE: Import external data - web query
    ... Your reply for my query is very extensive, this is for importing a file from ... The data source I want isn't listed in the Select Data Source dialog box. ... information used to connect to a database. ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)
  • RE: Import external data - web query
    ... The data source I want isn't listed in the Select Data Source dialog box. ... information used to connect to a database. ... I can't create a new data source in Microsoft Query. ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)
  • Re: Access sql with python, please. Im desperate
    ... > But I cannot even connect to the access database. ... we create and ODBC DSN (Data Source Name) ...
    (comp.lang.python)
  • Re: Help with java and sql
    ... When I open up (ODBC) and click ... on plantco, then configure and then test, it says success connection ... to change to J/Connector for your driver rather than the odbc driver. ... configure it,then configure the database source and choose the ...
    (comp.lang.java.databases)
  • RE: Changing data source on ODBC query
    ... I can't create a new data source in Microsoft Query. ... network and have the necessary permissions to connect to the database and log ... Check your driver First, make sure you have the right ODBC driver (Open ...
    (microsoft.public.excel.misc)