Skip to Content.
Sympa Menu

freetds - Re: [freetds] ODBC Username?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Andrew Shuttlewood <andrew.shuttlewood AT futureroute.co.uk>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ODBC Username?
  • Date: 25 Feb 2003 11:07:23 +0000

On Tue, 2003-02-25 at 10:55, Andrew Shuttlewood wrote:
> I've installed freetds-0.61rc yesterday, and I've been trying to use it
> with unixODBC. It appears to work using tsql (this is to a Sybase
> server).
>
> However, attempting to connect I always get told that the username is
> wrong. Looking at the dump file the username is not being sent (unlike
> with the tsql tool, which is sending it correctly)
>
> I have specified the username in the odbc.ini (UID = ...), yet it is
> obviously not being used. From what I can make out of connectparams in
> libtds, UID is the correct name for this parameter.

<snip> okay, my boo-boo - you have to specify it in the DSN string. I've
hacked the odbc stuff to parse it out of the odbc.ini and it appears to
work quite nicely. Fantastic.

in case anybody wants the change

------------ random hideous inline diff ------------
diff -ur freetds-0.61.orig/src/odbc/connectparams.c
freetds-0.61/src/odbc/connectparams.c
--- freetds-0.61.orig/src/odbc/connectparams.c 2003-01-04
13:06:57.000000000 +0000
+++ freetds-0.61/src/odbc/connectparams.c 2003-02-25
11:04:48.000000000 +0000
@@ -107,6 +107,10 @@
if (SQLGetPrivateProfileString(DSN, "Database", "", tmp,
FILENAME_MAX, "odbc.ini") > 0) {
tds_dstr_copy(&connect_info->database, tmp);
}
+ tmp[0] = '\0';
+ if (SQLGetPrivateProfileString(DSN, "UID", "", tmp,
FILENAME_MAX, "odbc.ini") > 0) {
+ tds_dstr_copy(&connect_info->user_name,tmp);
+ }
return 1;
}

@@ -211,6 +215,7 @@
++p;
}

+ // See if we have connection info
return 1;
}


I didn't spot that this was required anywhere, unless I totally missed that
part
of the documentation. Alternatively, is something going wrong that
shouldn't? Sorry if I seem stupid, but I haven't been able to fully grok
all of the documentation :|




Archive powered by MHonArc 2.6.24.

Top of Page