Skip to Content.
Sympa Menu

freetds - Re: [freetds] Connecting to DB using unixODBC from C

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Rattan, Neeta S" <nsratta AT sandia.gov>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Connecting to DB using unixODBC from C
  • Date: Tue, 17 Apr 2007 17:41:09 -0600

Hello again - I have solved my problem... It figures that right after I
post to the group, the answer becomes clear. :P

As it turns out, I had a problem with an earlier call, the
SqlAllocHandle() was returning an error that I wasn't catching until I
started going line by line with the error handling and there was no
problem with the SqlDriverConnect() line at all.

So, bottom line is please disregard my earlier posting. Thanks!

-Neeta

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Rattan, Neeta S
Sent: Tuesday, April 17, 2007 5:04 PM
To: freetds AT lists.ibiblio.org
Subject: [freetds] Connecting to DB using unixODBC from C

Hi,

I am very new to using freetds and am still at the point of connecting
to the DB using the unixODBC libs from C. I am using:
SQL Server version 8.0/Win2K
FreeTDS version 0.64
Client is Suse Linux

I have been able to successfully run and connect using both tsql and
isql, although I need to specify the username and password at the
command line as I was not using the DSN-less connect, so setting the
UID/PWD fields in the .ini files wouldn't be fruitful. Even if I set
them, and then leave out that info at the command line, it fails to
connect with error of "login failed for user ''" (ie. it thinks user is
blank).

However, from my C code using the SqlDriverConnect() function, I keep
getting a failed to connect error. I am specifying my connection string
to be "DSN=<dsnname>;UID=neeta;PWD=xxx" with no luck. If there are
thoughts on why this might be happening, I would much appreciate it!

In the meantime I am going to try to compile some of the sample code in
src/ although briefly looking at it, it looks quite similar to mine.

Thanks in advance,
Neeta Rattan

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






Archive powered by MHonArc 2.6.24.

Top of Page