Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

connection string help

0 views
Skip to first unread message

Mike

unread,
Feb 18, 2004, 2:11:51 PM2/18/04
to
I'm trying to connect to a SQL db, I have the db setup as a DSN on my
machine, here is my connection string that i'm trying to use.

string dbConn = "Provider=sqloeldb;data source=Tech;Initial
Catalog=Tech;Integrate Security=SSPI;";

on my page I get this error;

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access
denied.


and the error is pointing to

mbConn.Open() \\line

amd i missing something or doing something wrong?


Chris Jackson

unread,
Feb 18, 2004, 2:23:06 PM2/18/04
to
Since you are using Windows authentication, this connection string will only
work for you if the account you are running under (your ID for WinForms,
ASPNET by default for WebForms - though you can use impersonation to
authenticate with a domain account) has permissions on that server.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Mike" <cshar...@sbcglobal.net> wrote in message
news:OZEHSMl9...@TK2MSFTNGP12.phx.gbl...

Mike

unread,
Feb 18, 2004, 2:32:17 PM2/18/04
to
i'm running everything locally the SQL 2000 server, and the ASP.NET
application.
How can i get this configured to run? what am i missing


"Chris Jackson" <chrisjATmvpsDOTorgNOSPAM> wrote in message
news:ulydjSl9...@TK2MSFTNGP10.phx.gbl...

Rodrigo Meneses

unread,
Feb 18, 2004, 4:00:19 PM2/18/04
to
well, you would have to associate a login to the aspnet user

"Mike" <cshar...@sbcglobal.net> wrote in message
news:Oq$%23vXl9D...@tk2msftngp13.phx.gbl...

Cezary Nolewajka

unread,
Feb 18, 2004, 4:56:48 PM2/18/04
to
You can do two things:
- allow the ASPNET account access to the appropriate databases with the needed access rigths to the database objects
- or use the user id and password (SQL authentication as opposed to windows authentication) and indicate it in the connection string:

string dbConn = "Provider=sqloeldb;data source=Tech;Initial

Catalog=Tech;user id=username;password=password";

Both options have their advantages and disadvantages. Consider:
- ASPNET gives you access to the database to all the ASP.Net applications
- "user id" gives you different id for the database for every ASP.Net application but stores the pass in clear text in the web.config, unless you perform some custom encryption

In .Net it's possible to change the ASPNET account (in the machine.config) and indicate the password and account (but still in clear text). In .Net 1.1 it's possible to encrypt those in registry. There were some posts on how to accomplish that.

It's possible as well to "impersonate" the ASP.Net account and make it run under different credentials than ASPNET account, which gives you the opportunity to use Windows authentication with ASP.Net/SQL but still passowrd are stored in clear text in web.config.

--
Cezary Nolewajka
mailto:c.nolewajka...@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply

"Mike" <cshar...@sbcglobal.net> wrote in message news:Oq$%23vXl9D...@tk2msftngp13.phx.gbl...

Ruchi Gupta

unread,
Feb 18, 2004, 5:02:15 PM2/18/04
to
Hey check the spellings, shouldn't it be

Provider=sqloLEdb

string dbConn = "Provider=sqloeldb;data source=Tech;Initial
Catalog=Tech;Integrate Security=SSPI;";


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

0 new messages