Igor Korot | 1 Oct 2005 06:22
Picon
Favicon

Re: ODBCConfig execution question

Hi,
On the link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcprompting_the_user_for_connection_information.asp,
it is explained that if I try to connect to DB with the blank string as a connect string, I will get what i want.
Is this feature supports by the unixODBC application?

Thank you fro reply

-----Original Message-----
From: Igor Korot <ikorot <at> earthlink.net>
Sent: Sep 29, 2005 9:45 PM
To: Development issues and topics for unixODBC <unixodbc-dev <at> easysoft.com>, 
	Development issues and topics for unixODBC <unixodbc-dev <at> easysoft.com>
Subject: ODBCConfig execution question

Hi, ALL,
Is there some kind of utility or is it possible to run ODBCConfig the way so it will show only 2 pages: System
DSN and User DSN?

Thank you.

_______________________________________________
unixODBC-dev mailing list
unixODBC-dev <at> easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev

Nick Gorham | 1 Oct 2005 15:12
Favicon

Re: Re: ODBCConfig execution question

Igor Korot wrote:

>Hi,
>On the link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcprompting_the_user_for_connection_information.asp,
it is explained that if I try to connect to DB with the blank string as a connect string, I will get what i want.
>Is this feature supports by the unixODBC application?
>  
>
The prompt box is down to the driver, most drivers out there will not do 
this, easysofthave some that do, but this requires the driver load the 
setup lib when required. We didn;t want the driver to be dependent on 
GUI libs when theywould notbe needed 99.9% of the time.

Whatsyour app,and what drivers are you using?

--

-- 
Nick Gorham
Easysoft Limited
_______________________________________________
unixODBC-dev mailing list
unixODBC-dev <at> easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev

Igor Korot | 1 Oct 2005 19:30
Picon
Favicon

Re: Re: ODBCConfig execution question

Hi,
That's what I was talking about:

A generic application might take this one step further and not even specify a data source. When
SQLDriverConnect receives an empty connection string, the Driver Manager displays the following
dialog box.

After the user selects a data source, the Driver Manager constructs a connection string specifying that
data source and passes it to the driver. The driver can then prompt the user for any additional information
it needs.

The conditions under which the driver prompts the user are controlled by the DriverCompletion flag; there
are options to always prompt, prompt if necessary, or never prompt. For a complete description of this
flag, see the SQLDriverConnect function description.

The dialog box is attached.

Is it possible to do that with unixODBC?

Thank you.

-----Original Message-----
From: Nick Gorham <nick <at> lurcher.org>
Sent: Oct 1, 2005 6:12 AM
To: Igor Korot <ikorot <at> earthlink.net>, 
	Development issues and topics for unixODBC <unixodbc-dev <at> easysoft.com>
Subject: Re: [unixODBC-dev] Re: ODBCConfig execution question

Igor Korot wrote:

(Continue reading)

Igor Korot | 5 Oct 2005 08:50
Picon
Favicon

Driver enumeration

Hi, ALL,
The following code works under the Windows, but does not under Linux.

unsigned char *driverDesc = new unsigned char[512];
unsigned char *attrib = new unsigned char[512];
short length1 = 512, length2 = 512;
short descrLength = 512, attrLength = 512;
result = SQLDrivers( m_connectInf.GetHenv(), SQL_FETCH_NEXT, driverDesc, length1, &descrLength,
attrib, length2, &attrLength );
while( result != SQL_NO_DATA_FOUND )
{
	m_drivers->Append( driverDesc );
	result = SQLDrivers( m_connectInf.GetHenv(), SQL_FETCH_NEXT, driverDesc, length1, &descrLength,
attrib, length2, &attrLength );
}

On Windows , it gioves me a list of the all available ODBC drivers. On Linux, after installing the unixODBC,
and setting the TXT ODBC driver in the ODBCConfig, the driver doesn't show up.
The "m_drivers" is a l;ist box in a dialog.
I am not running it under the "root" on Linux, and I included the odbcinst.h file.

Can somebody lighten me up, please?
_______________________________________________
unixODBC-dev mailing list
unixODBC-dev <at> easysoft.com
http://mail.easysoft.com/mailman/listinfo/unixodbc-dev

Martin J. Evans | 5 Oct 2005 09:44
Favicon

RE: Driver enumeration

Ignor,

Shouldn't that be SQL_FETCH_FIRST in the first call to SQLDrivers.

What is in your odbcinst.ini file?

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

On 05-Oct-2005 Igor Korot wrote:
> Hi, ALL,
> The following code works under the Windows, but does not under Linux.
> 
> unsigned char *driverDesc = new unsigned char[512];
> unsigned char *attrib = new unsigned char[512];
> short length1 = 512, length2 = 512;
> short descrLength = 512, attrLength = 512;
> result = SQLDrivers( m_connectInf.GetHenv(), SQL_FETCH_NEXT, driverDesc,
> length1, &descrLength, attrib, length2, &attrLength );
> while( result != SQL_NO_DATA_FOUND )
> {
>       m_drivers->Append( driverDesc );
>       result = SQLDrivers( m_connectInf.GetHenv(), SQL_FETCH_NEXT, driverDesc,
> length1, &descrLength, attrib, length2, &attrLength );
> }
> 
> On Windows , it gioves me a list of the all available ODBC drivers. On Linux,
(Continue reading)

Igor Korot | 5 Oct 2005 17:44
Picon
Favicon

RE: Driver enumeration

Thank you for the reply.
According to MSDN, if I pas the SQL_FETCH_NEXT it will enumerate the drivers anyway, and like I said, it
works under Windows...

Thank you.

Ignor,

Shouldn't that be SQL_FETCH_FIRST in the first call to SQLDrivers.

What is in your odbcinst.ini file?

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

On 05-Oct-2005 Igor Korot wrote:
> Hi, ALL,
> The following code works under the Windows, but does not under Linux.
> 
> unsigned char *driverDesc = new unsigned char[512];
> unsigned char *attrib = new unsigned char[512];
> short length1 = 512, length2 = 512;
> short descrLength = 512, attrLength = 512;
> result = SQLDrivers( m_connectInf.GetHenv(), SQL_FETCH_NEXT, driverDesc,
> length1, &descrLength, attrib, length2, &attrLength );
> while( result != SQL_NO_DATA_FOUND )
> {
(Continue reading)

Martin J. Evans | 5 Oct 2005 17:48
Favicon

RE: Driver enumeration


On 05-Oct-2005 Igor Korot wrote:
> Thank you for the reply.
> According to MSDN, if I pas the SQL_FETCH_NEXT it will enumerate the drivers
> anyway, and like I said, it works under Windows...

Then I think it works accidentally since the ODBC spec says FETCH_NEXT
returns the next driver in the list a) after calling with FETCH_FIRST or b)
after calling SQLDrivers and it has returned SQL_NO_DATA.

I would still change the first call to SQL_FETCH_FIRST if I were you (better to
do as the spec says).

You never said what was in your odbcinst.ini file.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
Development

> Thank you.
> 
> Ignor,
> 
> Shouldn't that be SQL_FETCH_FIRST in the first call to SQLDrivers.
> 
> What is in your odbcinst.ini file?
> 
> Martin
(Continue reading)

Nick Gorham | 5 Oct 2005 18:17
Favicon

Re: Driver enumeration

Igor Korot wrote:
> Thank you for the reply.
> According to MSDN, if I pas the SQL_FETCH_NEXT it will enumerate the drivers anyway, and like I said, it
works under Windows...
> 
> Thank you.
> 
> Ignor,
> 
> Shouldn't that be SQL_FETCH_FIRST in the first call to SQLDrivers.
> 
> What is in your odbcinst.ini file?

Hi,

Looking at the code (always a option :-)), it should work fine with 
unixODBC as well, the only effect of using the SQL_FETCH_FIRST value, is 
it resets the internal pointer to know what to return

environment -> sql_driver_count

However, without the FIRST, then once this is done once, the call will 
always return SQL_NO_DATA once the last row is read.

--

-- 
Nick Gorham
Easysoft Limited
_______________________________________________
unixODBC-dev mailing list
unixODBC-dev <at> easysoft.com
(Continue reading)

Igor Korot | 5 Oct 2005 19:31
Picon
Favicon

RE: Driver enumeration

The contents of the odbcinst.ini is as follows:

[TXT driver]
Description = Text File ODBC driver
Driver = /usr/lib/libodbctxt.so
Setup = /usr/lib/libodbctxtS.so
FileUsage = 1
CPTimeout = 
CPReuse = 

Thank you.

Hi,

Looking at the code (always a option :-)), it should work fine with 
unixODBC as well, the only effect of using the SQL_FETCH_FIRST value, is 
it resets the internal pointer to know what to return

environment -> sql_driver_count

However, without the FIRST, then once this is done once, the call will 
always return SQL_NO_DATA once the last row is read.

--

-- 
Nick Gorham
Easysoft Limited

On 05-Oct-2005 Igor Korot wrote:
> Thank you for the reply.
> According to MSDN, if I pas the SQL_FETCH_NEXT it will enumerate the drivers
(Continue reading)

Igor Korot | 5 Oct 2005 19:33
Picon
Favicon

RE: Driver enumeration

>From MSDN:

If SQL_FETCH_NEXT is passed to SQLDrivers the very first time it is called, SQLDrivers returns the first
data source name.

Thank you.

-----Original Message-----
From: Igor Korot <ikorot <at> earthlink.net>
Sent: Oct 5, 2005 1:31 PM
To: Development issues and topics for unixODBC <unixodbc-dev <at> easysoft.com>
Subject: RE: [unixODBC-dev] Driver enumeration

The contents of the odbcinst.ini is as follows:

[TXT driver]
Description = Text File ODBC driver
Driver = /usr/lib/libodbctxt.so
Setup = /usr/lib/libodbctxtS.so
FileUsage = 1
CPTimeout = 
CPReuse = 

Thank you.

Hi,

Looking at the code (always a option :-)), it should work fine with 
unixODBC as well, the only effect of using the SQL_FETCH_FIRST value, is 
it resets the internal pointer to know what to return
(Continue reading)


Gmane