Skip to Content.
Sympa Menu

freetds - RE: [freetds] Sybase ASA 7, unixODBC problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Gene Dymarskiy" <gagarin AT i-dep.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Sybase ASA 7, unixODBC problem
  • Date: Tue, 9 Nov 2004 20:27:18 -0600

Cool. Thanks.

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of
lsunley AT mb.sympatico.ca
Sent: Tuesday, November 09, 2004 6:31 PM
To: FreeTDS Development Group
Subject: RE: [freetds] Sybase ASA 7, unixODBC problem

In <DD7A861A4B391843998031C3E19578D824195A AT MAIL.i-dep.com>, on 11/09/04
at 10:36 AM, "Gene Dymarskiy" <gagarin AT i-dep.com> said:

>I am not sure it is possible to pass "tds version" from odbc.ini

>It does not cause me problems now since I built FreeTDS with version
>5.0 but I can see this is being a drawback of not using freetds.conf
>settings with odbc

Sure you can.

The key is "TDS_Version"

In the connectparams.c file the odbc_get_dsn_info module has the code to
read the odbc.ini file parameters

----------------- cut from file ---------------------------

if (SQLGetPrivateProfileString(DSN, "Servername", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
freetds_conf_less = 0;
tds_read_conf_file(connect_info, tmp);
}
/* search for server (compatible with ms one) */
if (freetds_conf_less) {
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "Address", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
address_specified = 1;
/* TODO parse like MS */
tds_lookup_host(tmp, tmp);
tds_dstr_copy(&connect_info->ip_addr, tmp);
}
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "Server", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
tds_dstr_copy(&connect_info->server_name, tmp);
if (!address_specified) {

tds_lookup_host(tds_dstr_cstr(&connect_info->server_name), tmp);
tds_dstr_copy(&connect_info->ip_addr,
tmp);
}
}
}
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "Port", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
connect_info->port = atoi(tmp);
}
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "TDS_Version", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
tds_config_verstr(tmp, connect_info);
}
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "Language", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
tds_dstr_copy(&connect_info->language, tmp);
}
tmp[0] = '\0';
if (SQLGetPrivateProfileString(DSN, "Database", "", tmp,
FILENAME_MAX,
"odbc.ini") > 0) {
tds_dstr_copy(&connect_info->database, tmp);
}


------------------end cut -------------------------------

>> -----Original Message-----
>> From: freetds-bounces AT lists.ibiblio.org
>> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Lowden, James

>> K
>> Sent: Monday, November 08, 2004 2:53 PM
>> To: FreeTDS Development Group
>> Subject: RE: [freetds] Sybase ASA 7, unixODBC problem
>>
>> > From: Gene Dymarskiy
>> > Sent: Monday, November 08, 2004 10:49 AM
>> >
>> > > The correct server name can be obtained from the odbc.ini file by

>> > > specifying the keys "server"' and "address".
>> > > "address" is used to determine the host name/ip address of the
>> > > database server and "server" is used as the name sent off
>> with the
>> > > login packet.
>> >
>> > I can confirm that this works. Do not define "Servername"
>> in odbc.ini
>> >
>> > Instead specify Server, Address and Port keys. If you do
>> not specify
>> > "port" key it defaults to 4000.
>> >
>> > Sample odbc.ini entry
>> >
>> > [ASA7]
>> > Description = ASA Sybase
>> > Driver = /usr/local/lib/libtdsodbc.so
>> > Server = [ASA server name]
>> > Address = [IP address of the ASA server]
>> > Port = 2638
>> > Trace = Yes
>> > TraceFile = /tmp/odbc_sql.log
>> >
>> > This is much better than using DSQUERY. For one you can specify
>> > connections to multiple ASA servers ;)
>>
>> Ugh. OK, it works. That's about the best that can be said for it,
>> not that that's nothing. I mean, to pass a database name, we have to

>> give up minor features like DNS-lookup of the server's address. :-/
>>
>> Expect this to change one day. When you upgrade, check the README.
>> At least, there'll be an attribute in the DSN or freetds.conf entry
>> that supports a default database name.
>> Maybe maybe, we'll add 'DatabaseName'
>> as a connection string attribute, like (AIUI) Sybase does. (cf.
>> http://manuals.sybase.com/onlinebooks/group-sas/awg0703e/dbrfe
>> n7/@ebt-li
>> nk;pt=5012;uf=0?target=0;window=new;showtoc=true;book=dbrfen7 ).
>>
>> They also mention that if no database name is indicated, you'll be
>> connected to the Master database by default. Is there such thing in
>> ASA? If so, that should be our default, too. As far as we know,
>> non-ASA servers ignore this field, so we could set it to 'master' by
>> default all the time, not just for ASA servers.
>>
>> --jkl
>>
>> -----------------------------------------
>> The information contained in this transmission may contain privileged

>> and confidential information and is intended only for the use of the
>> person(s) named above. If you are not the intended recipient, or an
>> employee or agent responsible for delivering this message to the
>> intended recipient, any review, dissemination, distribution or
>> duplication of this communication is strictly prohibited. If you are
>> not the intended recipient, please contact the sender immediately by
>> reply e-mail and destroy all copies of the original message.
>> Please note that we do not accept account orders and/or instructions
>> by e-mail, and therefore will not be responsible for carrying out
>> such orders and/or instructions.
>> If you, as the intended recipient of this message, the purpose of
>> which is to inform and update our clients, prospects and consultants
>> of developments relating to our services and products, would not like

>> to receive further e-mail correspondence from the sender, please
>> "reply" to the sender indicating your wishes. In the U.S.: 1345
>> Avenue of the Americas, New York, NY 10105.
>>
>>
>> _______________________________________________
>> FreeTDS mailing list
>> FreeTDS AT lists.ibiblio.org
>> http://lists.ibiblio.org/mailman/listinfo/freetds
>>

>

>......CONFIDENTIALITY NOTICE......
>The information in this email may be confidential and/or privileged.
>This email is intended to be reviewed by only the individual or
>organization named above. If you are not the intended recipient or an
>authorized representative of the intended recipient, you are hereby
>notified that any review, dissemination or copying of this email and
>its attachments, if any, or the information contained herein is
prohibited.
>If you have received this email in error, please immediately notify the

>sender by return email and delete this email from your system. Thank
>You.


>_______________________________________________
>FreeTDS mailing list
>FreeTDS AT lists.ibiblio.org
>http://lists.ibiblio.org/mailman/listinfo/freetds

--
-----------------------------------------------------------
lsunley AT mb.sympatico.ca
-----------------------------------------------------------

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds



......CONFIDENTIALITY NOTICE......
The information in this email may be confidential and/or privileged. This
email is intended to be reviewed by only the individual or organization named
above. If you are not the intended recipient or an authorized representative
of the intended recipient, you are hereby notified that any review,
dissemination or copying of this email and its attachments, if any, or the
information contained herein is prohibited. If you have received this email
in error, please immediately notify the sender by return email and delete
this email from your system. Thank You.






Archive powered by MHonArc 2.6.24.

Top of Page