Showing posts with label connection. Show all posts
Showing posts with label connection. Show all posts

Friday, March 30, 2012

HELP!! SQL Server Express 2005 engine connection to my DB

Preface, I am just starting to learn about database and web development.

I installed VS.net 2005 which updated my web site project file and automatically attached it to a database. It connected to ".\app_data\aspnetdb.mdf". However it messed something up and the connection didn't work. If I create a project from scratch, it connects to its DB just fine, but not my upgraded project.

However, when I publish my web site, I need to use ODBC. So, my thought was to simply set up the system locally in a way that will make it easy to connect on the web site. I was told to add a system DSN to the "Microsoft ODBC Administrator". I tried to add a "SQL Server" and give it the database name but it failed to connect.

So, then I ran the SQL Server Configuration Manager and looked at the server properties and found this string under the advanced -> startup parameters.."-dc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;-ec:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;-lc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf"

My database is in an entirely different folder. The database it looks like it is servicing is a "master.mdf" database installed under the SQL server install folder. So, I figured that I found my problem. I just have to change this file to map to mine. I replaced these three strings with paths to my aspnetdb.mdf/ldf files, and created a LOG folder. Howwever, it wasn't able to connect to this database. It said something like "it doesn't exist or you don't have permission", even though I gave it the right path.

So, I'm at a loss for how to get my application to be able to use the ODBC interface to connect to its very own database on my local system.

What do I need to do? Please help!

You need to create a Windows Authentication account on the server for ASPNET with a password.

When an .aspx page loads and tries to access the server, it uses Windows Authentication unless you code the connectionstring to use SQL authentication.

After you create the ASPNET Account, make your connection string look like this:

connectionString="Data Source=ODC01;Initial Catalog=OEM;Integrated Security=True"

Adamus

|||

Thanks you for the feedback. Unfortunately I'm still a bit confused. My problem is that I don't have a complete picture of how this is supposed to work.

Are you saying that I must set up a the server to use an account that uses Windows Authentication before I can attach it to my own MDB file? In other words, it will only connect to the default master.mdb file until I create an account?

Also, using "local" or "system" isn't good enough, I have to specify a user account even on my own personal computer running XP? I am the only one who uses this system, and there is no windows server running on the network. This is my home setup.

This is the map that I understand. There are 3 connections that must be made for this to work.

mydb.mdb --1 (get server to serve my DB)--> SQL Server express 2005 --2 (tell ODBC about my DB exposed by the server)--> ODBC --3 (using the connection string)--> Website.

Right now I beleive none of the 3 connections are working, and I feel like I need to get the step 1 done before I can establish and verify step 2 and then finally use the connection string in step 3.

Are you saying that I must create a Windows Authentication user account before step 1 will work? Does that simply meen that I create a user called "SQL Server" with minimal access on the computer and log into it whenever I want it to connect?

Is there a "complete idiots guide to establishing a SQL server 2005 connection from your web site to your database" book that I could buy?

|||

I take it all back. You were right. Now I understand. I actually had the account set up correctly on the server side, but I wasn't logging in correctly.

Second, when I tried to attach the server to ODBC I was using my computer name alone, when I needed to use <computer_name>\SQLExpress.

Now I have to figure out the connection string. But I am finally over my biggest hurdle. Thanks!

HELP!! SQL Server Express 2005 engine connection to my DB

Preface, I am just starting to learn about database and web development.

I installed VS.net 2005 which updated my web site project file and automatically attached it to a database. It connected to ".\app_data\aspnetdb.mdf". However it messed something up and the connection didn't work. If I create a project from scratch, it connects to its DB just fine, but not my upgraded project.

However, when I publish my web site, I need to use ODBC. So, my thought was to simply set up the system locally in a way that will make it easy to connect on the web site. I was told to add a system DSN to the "Microsoft ODBC Administrator". I tried to add a "SQL Server" and give it the database name but it failed to connect.

So, then I ran the SQL Server Configuration Manager and looked at the server properties and found this string under the advanced -> startup parameters.."-dc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf;-ec:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG;-lc:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf"

My database is in an entirely different folder. The database it looks like it is servicing is a "master.mdf" database installed under the SQL server install folder. So, I figured that I found my problem. I just have to change this file to map to mine. I replaced these three strings with paths to my aspnetdb.mdf/ldf files, and created a LOG folder. Howwever, it wasn't able to connect to this database. It said something like "it doesn't exist or you don't have permission", even though I gave it the right path.

So, I'm at a loss for how to get my application to be able to use the ODBC interface to connect to its very own database on my local system.

What do I need to do? Please help!

You need to create a Windows Authentication account on the server for ASPNET with a password.

When an .aspx page loads and tries to access the server, it uses Windows Authentication unless you code the connectionstring to use SQL authentication.

After you create the ASPNET Account, make your connection string look like this:

connectionString="Data Source=ODC01;Initial Catalog=OEM;Integrated Security=True"

Adamus

|||

Thanks you for the feedback. Unfortunately I'm still a bit confused. My problem is that I don't have a complete picture of how this is supposed to work.

Are you saying that I must set up a the server to use an account that uses Windows Authentication before I can attach it to my own MDB file? In other words, it will only connect to the default master.mdb file until I create an account?

Also, using "local" or "system" isn't good enough, I have to specify a user account even on my own personal computer running XP? I am the only one who uses this system, and there is no windows server running on the network. This is my home setup.

This is the map that I understand. There are 3 connections that must be made for this to work.

mydb.mdb --1 (get server to serve my DB)--> SQL Server express 2005 --2 (tell ODBC about my DB exposed by the server)--> ODBC --3 (using the connection string)--> Website.

Right now I beleive none of the 3 connections are working, and I feel like I need to get the step 1 done before I can establish and verify step 2 and then finally use the connection string in step 3.

Are you saying that I must create a Windows Authentication user account before step 1 will work? Does that simply meen that I create a user called "SQL Server" with minimal access on the computer and log into it whenever I want it to connect?

Is there a "complete idiots guide to establishing a SQL server 2005 connection from your web site to your database" book that I could buy?

|||

I take it all back. You were right. Now I understand. I actually had the account set up correctly on the server side, but I wasn't logging in correctly.

Second, when I tried to attach the server to ODBC I was using my computer name alone, when I needed to use <computer_name>\SQLExpress.

Now I have to figure out the connection string. But I am finally over my biggest hurdle. Thanks!

Monday, March 12, 2012

Help! First timer with SQL

I am trying to write my first app using SQL Server. I am not able to even open a connection. I get the following error message:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I am not sure first of all why the user is listed as null. I hard coded a user name in for test purposes. Second, how DO I establish a trusted connection with a SQL Server. The SQL Server is located on an internal domain controller.

Also, is it necessary to have anything special installed on my remote machine? As I said, I am VERY new to Microsoft SQL ServerCan you post your conn string?|||Sure... here is the connection string. It was generated by default by the system.

data source=ERICSERVER;initial catalog=Northwind;integrated security=SSPI;persist security info=False;workstation id=ERIC;packet size=4096

Any ideas?|||ejcrammer I 2 am also in your shoes. I am new to SQL Server and ASP.NET. I also am trying to connect to a database and am receving the same error message you are. I have looked at your connection string but their does not seem to be one specific way to write the connection string because I have seen about 7 different versions all of which are not good and no one really explains them in detail. some ask for password and username some dont, I dont know. Anyway since were both in the same shoes I was wondering if you figure out this answere to this question you could post and let me know and I as well will post back if I figure out the answere to this problem we seem to be haveing.
Thanks

help! data connection

i am using VS05 and sql05express. After I created a new web application i want to add a database. But when I do so i got the following message:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

is anybody know what's wrong here? what should i do? thx

This error has been asked many times on the forumSmile Firstly you should ensure you have enabled remote connection of the SQL Express from 'SQL Server Surface Area Configuration'; then enable TCP/IP and Named Pipe protocol on both Server and Client side in 'SQL Server Configuraiton Manager'. After that, if you still have problem, you should check your conneciton string.|||thank you very much, now i am all set to goBig Smile

Friday, March 9, 2012

help! connection to SQL express

i have downloaded and set up SQL Express on my desktop. When i click connection, it only shows server on the network (in the office). i want to connect to the sample database on my machine (don't want to connect to servers in the office), how can i do that?

hi,

just fill the Server property with the actual instance name you want to connect to.. if you installed a named instance "named" SQLExpress, the default for SQLExpress installation, you can locally connect to it specifying "(Local)\SQLExpress" or "ComputerName\SQLExpress" as the server...

regards

Monday, February 27, 2012

HELP!

i am running a windows sharepoint services site.. I get an error that says "Unable to connect to database. Check database connection information and make sure the database server is running."
i check my event log and get this..
Event Type:Information
Event Source:MSSQLSERVER/MSDE
Event Category:None
Event ID:1
Date:5/10/2004
Time:8:49:04 AM
User:N/A
Computer:211551S
Description:
You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer'
s vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or M
SDE from http://www.microsoft.com/sql/downloads/default.asp
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
how do I get this thing up and running again.. please e-mail me at jason_adolf@.sra.com
That's an informational message in your event log that you
will get if you are running SQL Server at something less
than SP3. You should install SQL Server SP3.
-Sue
On Mon, 10 May 2004 06:01:05 -0700, jason7
<jason_adolf@.sra.com> wrote:

>i am running a windows sharepoint services site.. I get an error that says "Unable to connect to database. Check database connection information and make sure the database server is running."
>i check my event log and get this..
>Event Type:Information
>Event Source:MSSQLSERVER/MSDE
>Event Category:None
>Event ID:1
>Date:5/10/2004
>Time:8:49:04 AM
>User:N/A
>Computer:211551S
>Description:
>You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer
's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or
MSDE from http://www.microsoft.com/sql/downloads/default.asp
>For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
>
>how do I get this thing up and running again.. please e-mail me at jason_adolf@.sra.com

HELP!

i am running a windows sharepoint services site.. I get an error that says
"Unable to connect to database. Check database connection information and m
ake sure the database server is running."
i check my event log and get this..
Event Type: Information
Event Source: MSSQLSERVER/MSDE
Event Category: None
Event ID: 1
Date: 5/10/2004
Time: 8:49:04 AM
User: N/A
Computer: 211551S
Description:
You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Serv
er 2000 Desktop Engine (also called MSDE) that has known security vulnerabil
ities when used in conjunction with the Microsoft Windows Server 2003 family
. To reduce your computer'
s vulnerability to certain virus attacks, the TCP/IP and UDP network ports o
f Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable th
ese ports, you must install a patch, or the most recent service pack for Mic
rosoft SQL Server 2000 or M
SDE from http://www.microsoft.com/sql/downloads/default.asp
For more information, see Help and Support Center at k/events.asp." target="_blank">http://go.microsoft.com/fwlin
k/events.asp.
how do I get this thing up and running again.. please e-mail me at jason_ado
lf@.sra.comThat's an informational message in your event log that you
will get if you are running SQL Server at something less
than SP3. You should install SQL Server SP3.
-Sue
On Mon, 10 May 2004 06:01:05 -0700, jason7
<jason_adolf@.sra.com> wrote:

>i am running a windows sharepoint services site.. I get an error that says
"Unable to connect to database. Check database connection information and
make sure the database server is running."
>i check my event log and get this..
>Event Type: Information
>Event Source: MSSQLSERVER/MSDE
>Event Category: None
>Event ID: 1
>Date: 5/10/2004
>Time: 8:49:04 AM
>User: N/A
>Computer: 211551S
>Description:
>You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000
Desktop Engine (also called MSDE) that has known security vulnerabilities when used
in conjunction with the Microsoft Windows Server 2003 family. To reduce your compu
ter
's vulnerability to certain virus attacks, the TCP/IP and UDP network ports
of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable t
hese ports, you must install a patch, or the most recent service pack for Mi
crosoft SQL Server 2000 or
MSDE from http://www.microsoft.com/sql/downloads/default.asp
>For more information, see Help and Support Center at nk/events.asp." target="_blank">http://go.microsoft.com/fwli
nk/events.asp.
>
>how do I get this thing up and running again.. please e-mail me at jason_adolf@.sra.
com

HELP!

i am running a windows sharepoint services site.. I get an error that says "Unable to connect to database. Check database connection information and make sure the database server is running.
i check my event log and get this.
Event Type: Informatio
Event Source: MSSQLSERVER/MSD
Event Category: Non
Event ID:
Date: 5/10/200
Time: 8:49:04 A
User: N/
Computer: 211551
Description
You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or MSDE from http://www.microsoft.com/sql/downloads/default.as
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp
how do I get this thing up and running again.. please e-mail me at jason_adolf@.sra.comThat's an informational message in your event log that you
will get if you are running SQL Server at something less
than SP3. You should install SQL Server SP3.
-Sue
On Mon, 10 May 2004 06:01:05 -0700, jason7
<jason_adolf@.sra.com> wrote:
>i am running a windows sharepoint services site.. I get an error that says "Unable to connect to database. Check database connection information and make sure the database server is running."
>i check my event log and get this..
>Event Type: Information
>Event Source: MSSQLSERVER/MSDE
>Event Category: None
>Event ID: 1
>Date: 5/10/2004
>Time: 8:49:04 AM
>User: N/A
>Computer: 211551S
>Description:
>You are running a version of Microsoft SQL Server 2000 or Microsoft SQL Server 2000 Desktop Engine (also called MSDE) that has known security vulnerabilities when used in conjunction with the Microsoft Windows Server 2003 family. To reduce your computer's vulnerability to certain virus attacks, the TCP/IP and UDP network ports of Microsoft SQL Server 2000, MSDE, or both have been disabled. To enable these ports, you must install a patch, or the most recent service pack for Microsoft SQL Server 2000 or MSDE from http://www.microsoft.com/sql/downloads/default.asp
>For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
>
>how do I get this thing up and running again.. please e-mail me at jason_adolf@.sra.com