Thread: use psqlodbc on Windows without Windows driver manager?

use psqlodbc on Windows without Windows driver manager?

From
"Dieter Mueller (BOI GmbH)"
Date:
Hello,

is psql-odbc designed to work on Windows without the Windows ODBC driver
manager?

(I want to prepare a distribution of our software for testing purposes
that can be used without any installation on Windows - no ODBC driver
installation as well)

I created my own psqlodbc30a.lib of psqlodbc30a.dll by calling MS tools
"dumpbin /exports ..." and "lib /def:...", then I linked my ODBC
application with the new psqlodbc30a.lib instead of Microsoft's
obdc32.lib and odbccp32.lib.

--> seems to work fine, but is the psql-odbc driver designed to run
without a driver manager, or must I expect problems when it is used this
way?

Kind regards,
Dieter Mueller


Re: use psqlodbc on Windows without Windows driver manager?

From
"Tsunakawa, Takayuki"
Date:
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dieter Mueller (BOI
> GmbH)
> is psql-odbc designed to work on Windows without the Windows ODBC driver
> manager?
> 
> (I want to prepare a distribution of our software for testing purposes that
> can be used without any installation on Windows - no ODBC driver installation
> as well)
> 
> I created my own psqlodbc30a.lib of psqlodbc30a.dll by calling MS tools
> "dumpbin /exports ..." and "lib /def:...", then I linked my ODBC application
> with the new psqlodbc30a.lib instead of Microsoft's obdc32.lib and
> odbccp32.lib.

I don't think it's reasonable.  According to the ODBC spec, the Driver Manager does many tasks, including error checks,
andthe ODBC driver depends on it.
 

Why do you want to avoid linking with odbc32.lib?

Regards
Takayuki Tsunakawa

Re: use psqlodbc on Windows without Windows driver manager?

From
"Dieter Mueller (BOI GmbH)"
Date:
Hello Takayuki,

thanks for your reply :-)
Calling the ODBC driver via driver manager requires the driver to be
installed in Windows (means: written in the Windows registry). But a
test distribution of our (ODBC-)application should be able to run
without the need of any installation procedure and without administrator
rights.
IBM's DB2-CLI (call level interface) can be operated in 2 modes: with or
without an ODBC driver manager. So i hoped that the PostgreSQL ODBC
driver has this ability, too.

Kind regards,
Dieter Mueller


-------- Original-Nachricht --------
Betreff: Re: [ODBC] use psqlodbc on Windows without Windows driver manager?
Von: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
An: Dieter Mueller (BOI GmbH) <dieter.mueller@boi.at>,
pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Datum: 12.04.2016 02:35

>> From: pgsql-odbc-owner@postgresql.org
>> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dieter Mueller (BOI
>> GmbH)
>> is psql-odbc designed to work on Windows without the Windows ODBC driver
>> manager?
>>
>> (I want to prepare a distribution of our software for testing purposes that
>> can be used without any installation on Windows - no ODBC driver installation
>> as well)
>>
>> I created my own psqlodbc30a.lib of psqlodbc30a.dll by calling MS tools
>> "dumpbin /exports ..." and "lib /def:...", then I linked my ODBC application
>> with the new psqlodbc30a.lib instead of Microsoft's obdc32.lib and
>> odbccp32.lib.
>
> I don't think it's reasonable.  According to the ODBC spec, the Driver Manager does many tasks, including error
checks,and the ODBC driver depends on it. 
>
> Why do you want to avoid linking with odbc32.lib?
>
> Regards
> Takayuki Tsunakawa
>


Re: use psqlodbc on Windows without Windows driver manager?

From
"Prisma Computer - M. Neumann"
Date:
Hello Dieter,

it is possible to use the odbc-driver without the windows driver manager.

You only need to change the connection-function. Instead of Calling
SQLConnect use SQLDriverConnect with the correct connectionstring.

Kind regards,
Malte

Am 12.04.2016 um 08:41 schrieb Dieter Mueller (BOI GmbH):
> Hello Takayuki,
>
> thanks for your reply :-)
> Calling the ODBC driver via driver manager requires the driver to be
> installed in Windows (means: written in the Windows registry). But a
> test distribution of our (ODBC-)application should be able to run
> without the need of any installation procedure and without
> administrator rights.
> IBM's DB2-CLI (call level interface) can be operated in 2 modes: with
> or without an ODBC driver manager. So i hoped that the PostgreSQL ODBC
> driver has this ability, too.
>
> Kind regards,
> Dieter Mueller
>
>
> -------- Original-Nachricht --------
> Betreff: Re: [ODBC] use psqlodbc on Windows without Windows driver
> manager?
> Von: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
> An: Dieter Mueller (BOI GmbH) <dieter.mueller@boi.at>,
> pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
> Datum: 12.04.2016 02:35
>
>>> From: pgsql-odbc-owner@postgresql.org
>>> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dieter Mueller
>>> (BOI
>>> GmbH)
>>> is psql-odbc designed to work on Windows without the Windows ODBC
>>> driver
>>> manager?
>>>
>>> (I want to prepare a distribution of our software for testing
>>> purposes that
>>> can be used without any installation on Windows - no ODBC driver
>>> installation
>>> as well)
>>>
>>> I created my own psqlodbc30a.lib of psqlodbc30a.dll by calling MS tools
>>> "dumpbin /exports ..." and "lib /def:...", then I linked my ODBC
>>> application
>>> with the new psqlodbc30a.lib instead of Microsoft's obdc32.lib and
>>> odbccp32.lib.
>>
>> I don't think it's reasonable.  According to the ODBC spec, the
>> Driver Manager does many tasks, including error checks, and the ODBC
>> driver depends on it.
>>
>> Why do you want to avoid linking with odbc32.lib?
>>
>> Regards
>> Takayuki Tsunakawa
>>
>
>

--
Prisma Computer GmbH
Sternallee 89  -  68723 Schwetzingen
Fon 0 62 02.5 75 68 10
Fax 0 62 02.5 75 68 75
eMail: m.neumann@prisma-computer.de
Internet: www.prisma-computer.de

Geschäftsführung: Gerald Wilkens, Bernhard Goebel
Amtsgericht Mannheim HRB 420986 S
USt-IdNr.: DE 144 278 153




Re: [MASSMAIL]Re: use psqlodbc on Windows without Windows driver manager?

From
"Dieter Mueller (BOI GmbH)"
Date:
Hello Malte,

the application already calls SQLDriverConnect, which works fine with
and without the driver manager. Thank you very much :-)

Kind regards,
Viele Grüße,

Dieter Mueller


Am 13.04.2016 um 10:48 schrieb Prisma Computer - M. Neumann:
> Hello Dieter,
>
> it is possible to use the odbc-driver without the windows driver manager.
>
> You only need to change the connection-function. Instead of Calling
> SQLConnect use SQLDriverConnect with the correct connectionstring.
>
> Kind regards,
> Malte
>
> Am 12.04.2016 um 08:41 schrieb Dieter Mueller (BOI GmbH):
>> Hello Takayuki,
>>
>> thanks for your reply :-)
>> Calling the ODBC driver via driver manager requires the driver to be
>> installed in Windows (means: written in the Windows registry). But a
>> test distribution of our (ODBC-)application should be able to run
>> without the need of any installation procedure and without
>> administrator rights.
>> IBM's DB2-CLI (call level interface) can be operated in 2 modes: with
>> or without an ODBC driver manager. So i hoped that the PostgreSQL ODBC
>> driver has this ability, too.
>>
>> Kind regards,
>> Dieter Mueller
>>
>>
>> -------- Original-Nachricht --------
>> Betreff: Re: [ODBC] use psqlodbc on Windows without Windows driver
>> manager?
>> Von: Tsunakawa, Takayuki <tsunakawa.takay@jp.fujitsu.com>
>> An: Dieter Mueller (BOI GmbH) <dieter.mueller@boi.at>,
>> pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
>> Datum: 12.04.2016 02:35
>>
>>>> From: pgsql-odbc-owner@postgresql.org
>>>> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Dieter Mueller
>>>> (BOI
>>>> GmbH)
>>>> is psql-odbc designed to work on Windows without the Windows ODBC
>>>> driver
>>>> manager?
>>>>
>>>> (I want to prepare a distribution of our software for testing
>>>> purposes that
>>>> can be used without any installation on Windows - no ODBC driver
>>>> installation
>>>> as well)
>>>>
>>>> I created my own psqlodbc30a.lib of psqlodbc30a.dll by calling MS tools
>>>> "dumpbin /exports ..." and "lib /def:...", then I linked my ODBC
>>>> application
>>>> with the new psqlodbc30a.lib instead of Microsoft's obdc32.lib and
>>>> odbccp32.lib.
>>>
>>> I don't think it's reasonable.  According to the ODBC spec, the
>>> Driver Manager does many tasks, including error checks, and the ODBC
>>> driver depends on it.
>>>
>>> Why do you want to avoid linking with odbc32.lib?
>>>
>>> Regards
>>> Takayuki Tsunakawa
>>>
>>
>>
>


Re: use psqlodbc on Windows without Windows driver manager?

From
"Tsunakawa, Takayuki"
Date:
Hello, Malte,


Dieter wants to use the driver without registering it in the registry.  Is it really possible?  I know I can connect to
thedatabase without "registering the data source" with the connection string for SQLDriverConnect() like this:
 

    DRIVER={PostgreSQL ANSI Driver};Servername=127.0.0.1;Port=5432;UID=xxx;Password=yyy;Database=postgres

FYI, I tried setting the absolute path of the driver DLL file to DRIVER keyword, but it didn't work.

Regards
Takayuki Tsunakawa


> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Prisma Computer -
> M. Neumann
> Sent: Wednesday, April 13, 2016 5:49 PM
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] use psqlodbc on Windows without Windows driver manager?
> 
> Hello Dieter,
> 
> it is possible to use the odbc-driver without the windows driver manager.
> 
> You only need to change the connection-function. Instead of Calling
> SQLConnect use SQLDriverConnect with the correct connectionstring.
> 
> Kind regards,
> Malte


Re: use psqlodbc on Windows without Windows driver manager?

From
"Prisma Computer - M. Neumann"
Date:
Hello Takayuki,

yes it is possible, we use it.

But it is a little bit tricky, because you must load the driver dll by
yourself with the loadLibrary function. After that you have to import
alle your needed dll-functions with the GetProcAddress.

Kind Regards,
Malte


Am 14.04.2016 um 02:16 schrieb Tsunakawa, Takayuki:
> Hello, Malte,
>
>
> Dieter wants to use the driver without registering it in the registry.  Is it really possible?  I know I can connect
tothe database without "registering the data source" with the connection string for SQLDriverConnect() like this: 
>
>      DRIVER={PostgreSQL ANSI Driver};Servername=127.0.0.1;Port=5432;UID=xxx;Password=yyy;Database=postgres
>
> FYI, I tried setting the absolute path of the driver DLL file to DRIVER keyword, but it didn't work.
>
> Regards
> Takayuki Tsunakawa
>
>
>> -----Original Message-----
>> From: pgsql-odbc-owner@postgresql.org
>> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Prisma Computer -
>> M. Neumann
>> Sent: Wednesday, April 13, 2016 5:49 PM
>> To: pgsql-odbc@postgresql.org
>> Subject: Re: [ODBC] use psqlodbc on Windows without Windows driver manager?
>>
>> Hello Dieter,
>>
>> it is possible to use the odbc-driver without the windows driver manager.
>>
>> You only need to change the connection-function. Instead of Calling
>> SQLConnect use SQLDriverConnect with the correct connectionstring.
>>
>> Kind regards,
>> Malte
>

--
Prisma Computer GmbH
Sternallee 89  -  68723 Schwetzingen
Fon 0 62 02.5 75 68 10
Fax 0 62 02.5 75 68 75
eMail: m.neumann@prisma-computer.de
Internet: www.prisma-computer.de

Geschäftsführung: Gerald Wilkens, Bernhard Goebel
Amtsgericht Mannheim HRB 420986 S
USt-IdNr.: DE 144 278 153




Re: [MASSMAIL]Re: use psqlodbc on Windows without Windows driver manager?

From
"Dieter Mueller (BOI GmbH)"
Date:
Hello Takayuki and Malte,

there is another way:
you can create an import library of the ODBC driver (using MS tools
DUMPBIN and LIB), and link your application with the resulting .LIB-file
instead of Microsoft's odbc32.lib.

Kind regards,
Dieter Mueller


Am 14.04.2016 um 09:34 schrieb Prisma Computer - M. Neumann:
> Hello Takayuki,
>
> yes it is possible, we use it.
>
> But it is a little bit tricky, because you must load the driver dll by
> yourself with the loadLibrary function. After that you have to import
> alle your needed dll-functions with the GetProcAddress.
>
> Kind Regards,
> Malte
>
>
> Am 14.04.2016 um 02:16 schrieb Tsunakawa, Takayuki:
>> Hello, Malte,
>>
>>
>> Dieter wants to use the driver without registering it in the
>> registry.  Is it really possible?  I know I can connect to the
>> database without "registering the data source" with the connection
>> string for SQLDriverConnect() like this:
>>
>>      DRIVER={PostgreSQL ANSI
>> Driver};Servername=127.0.0.1;Port=5432;UID=xxx;Password=yyy;Database=postgres
>>
>>
>> FYI, I tried setting the absolute path of the driver DLL file to
>> DRIVER keyword, but it didn't work.
>>
>> Regards
>> Takayuki Tsunakawa
>>
>>
>>> -----Original Message-----
>>> From: pgsql-odbc-owner@postgresql.org
>>> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Prisma Computer -
>>> M. Neumann
>>> Sent: Wednesday, April 13, 2016 5:49 PM
>>> To: pgsql-odbc@postgresql.org
>>> Subject: Re: [ODBC] use psqlodbc on Windows without Windows driver
>>> manager?
>>>
>>> Hello Dieter,
>>>
>>> it is possible to use the odbc-driver without the windows driver
>>> manager.
>>>
>>> You only need to change the connection-function. Instead of Calling
>>> SQLConnect use SQLDriverConnect with the correct connectionstring.
>>>
>>> Kind regards,
>>> Malte
>>
>


Re: use psqlodbc on Windows without Windows driver manager?

From
"Tsunakawa, Takayuki"
Date:
Hello, Malte, Dieter,

> From: pgsql-odbc-owner@postgresql.org
> But it is a little bit tricky, because you must load the driver dll by yourself
> with the loadLibrary function. After that you have to import alle your needed
> dll-functions with the GetProcAddress.

Directly loading psqlodbc's DLL eliminates the Driver Manager.  But as I replied to Dieter's initial question, that may
causeproblems because the Driver Manager does various things and the driver depends on it.
 

What Dieter requires is to link with odbc32.lib to use psqlodbc via the Driver Manager without registering psqlodbc in
theregistry.
 

Regards
Takayuki Tsunakawa