ODBC Conections

  • Thread starter Thread starter roundcrisis
  • Start date Start date
R

roundcrisis

hi:
I m trying to generate ODBC connections on the fly with C# in "user
friendly way"
is there any way to bring that connection manager over from office?
or is there a better way?

cheers
 
hi:
I m trying to generate ODBC connections on the fly with C# in "user
friendly way"
is there any way to bring that connection manager over from office?
or is there a better way?

cheers

or at least some indications on how to work with odbc, I know how to
use a conection string I just really dont want to rewite a connection
string wizard, there must be somethign out there
cheers
 
or at least some indications on how to work withodbc, I know how to
use a conection string I just really dont want to rewite a connection
string wizard, there must be somethign out there
cheers

??
 
What, specifically, are you wanting to know? How to form the ODBC
connection string? How to make a connection using OdbcConnection?- Hide quoted text -

- Show quoted text -

Well I find really strange the fact that there is no standard default
way to connect using ODBC to handle all this by default and that each
one has to deal with it. leaving that aside
My problem is that when I create a user DSN using ODBCCP32.dll I
have to enter (for a sql server) a username and password
however, when i try to use it or open the conneciton then username and
password is lost and on Open it tries to use the default
authentication and fails
so, baiscally the question is:

How to get a prompt for user name and password only of necessary or is
there any way to create a DSN saying (save my username and password)
of course i cna also do this myself but I would only really be
catching the case for sql server because there may be other
requirements for differnet connecitons string

Thanks
 
Well I find really strange the fact that there is no standard default
way to connect using ODBC to handle all this by default and that each
one has to deal with it. leaving that aside
My problem is that when I create a user DSN using ODBCCP32.dll I
have to enter (for a sql server) a username and password
however, when i try to use it or open the conneciton then username and
password is lost and on Open it tries to use the default
authentication and fails
so, baiscally the question is:

How to get a prompt for user name and password only of necessary or is
there any way to create a DSN saying (save my username and password)
of course i cna also do this myself but I would only really be
catching the case for sql server because there may be other
requirements for differnet connecitons string

Thanks

If you don't specify a username and password then usually what happens
is authentication is processed using the credentials of the currently
running process.

If you want to specify a username and password in the connection
string then do the following.

Dsn=<dsn>;Uid=<username>;Pwd=<password>
 
If you don't specify a username and password then usually what happens
is authentication is processed using the credentials of the currently
running process.

If you want to specify a username and password in the connection
string then do the following.

Dsn=<dsn>;Uid=<username>;Pwd=<password>- Hide quoted text -

- Show quoted text -

sure but thats not required for all dsn types, so that means i ll have
to hard code and a switch to check if i should pop up a user pass
thing for the types I know is requested, if the user installs a new
driver that I didnt code, then this is going to fail
this is why im trying to use something that is out there already :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top