473,407 Members | 2,629 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

connection string help

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
5 1853
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Fred Zuckerman | last post by:
Hello All, After reading in this group about the preference for connecting to a SQL Server using a connection string instead of a DSN file, I have done just that. BUT, I cannot update my data....
4
by: Rahul Anand | last post by:
Getting SQL Exception when trying to implement Connection based Trasaction using SQL Helper class. I am using the follwing function to execute my stored procs: -=-=-=- ExecuteScalar(ByVal...
6
by: Jon Davis | last post by:
I like the drag-and-drop accessibility of dragging a table to a Web Forms designer and seeing a SqlDataAdapter automatically created for me.. being able to create a DataSet from that is fun and...
7
by: momo | last post by:
Hello to all, I need some help. I am looking for a database connection function that I can use in my ASP.NET site. This would be in VB.NET. What I want to be able to do is call the function and...
37
by: sam44 | last post by:
Hi, At startup the user log on and chooses the name of a client from a dropdownlist, which then changes dynamically the connection string (the name of the client indicates which database to use)....
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
7
by: Bill Nguyen | last post by:
I have this connection string using ODBC DSN Dim FactorJaco As String = "dsn=jaco;catalog=factor;uid=user;pwd=passord" This requires an ODBC DSN (jaco) at every client PC. I need to use DSN-less...
13
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I...
6
Cintury
by: Cintury | last post by:
Hi all, I've developed a mobile application for windows mobile 5.0 that has been in use for a while (1 year and a couple of months). It was developed in visual studios 2005 with a back-end sql...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.