By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,414 Members | 1,057 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,414 IT Pros & Developers. It's quick & easy.

connection string help

P: n/a
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?
Nov 15 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <cs*********@sbcglobal.net> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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?

Nov 15 '05 #2

P: n/a
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:ul**************@TK2MSFTNGP10.phx.gbl...
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" <cs*********@sbcglobal.net> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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?


Nov 15 '05 #3

P: n/a
well, you would have to associate a login to the aspnet user
"Mike" <cs*********@sbcglobal.net> wrote in message
news:Oq****************@tk2msftngp13.phx.gbl...
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:ul**************@TK2MSFTNGP10.phx.gbl...
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" <cs*********@sbcglobal.net> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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?



Nov 15 '05 #4

P: n/a
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.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply

"Mike" <cs*********@sbcglobal.net> wrote in message news:Oq****************@tk2msftngp13.phx.gbl...
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:ul**************@TK2MSFTNGP10.phx.gbl...
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" <cs*********@sbcglobal.net> wrote in message
news:OZ**************@TK2MSFTNGP12.phx.gbl...
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?



Nov 15 '05 #5

P: n/a
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!
Nov 15 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.