Setting up MSDE 2000 Release A on Windows XP Professional

  • Thread starter Nathan Sokalski
  • Start date
N

Nathan Sokalski

I recently downloaded and installed (hopefully correctly) MSDE 2000 Release
A. I previously, and still do, have the version of IIS that comes with XP
Professional installed on my computer. I wanted MSDE 2000 Release A so that
I could do database access using ASP from my websites, which are on my
computer. When I went to my first test website, I recieved the following
error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied
/testDB.asp, line 26

The ASP code that I used on my web to connect to the database (which is
currently just an empty text file) is the following:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL Server};" &_
"DBQ=" & Server.MapPath("testDB")

conn.Open connectstring

The error, obviously, is in the last line I have shown. Because I am
somewhat new to server setup, I am not sure what I need to do to make this
work. If anyone would be willing to help me, I would greatly appreciate it.
Thanks.
 
A

Aaron Bertrand [MVP]

connectstring="Driver={SQL Server};" &_
"DBQ=" & Server.MapPath("testDB")

You've mixed up SQL Server and Access connection strings. MSDE does not
have a file called "testDB" and even if it did, it would not live in the
same folder as your ASP page. See http://www.aspfaq.com/2126 for valid SQL
Server connection strings.
 
N

Nathan Sokalski

I think I am getting closer to my goal, but I am not sure where to go next.
My current error that I recieve is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'NJS\IUSR_NJS'.
/testDB.asp, line 25

(line 25 in my code is conn.Open connectstring)


And my current code for opening the connection is:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL
Server};Server=NJS;Database=pubs;Trusted_Connection=yes;"

conn.Open connectstring

(NJS is the name of my computer, I figured that is what I was supposed to
put there)
I am not sure what I am supposed to do to fix this problem, since there are
no user or password fields/attributes in the connection string, as well as
the fact that there is an attribute called "Trusted_Connection" . I also do
not want the user (even though it will normally only be me, since I
primarily want this only for testing my websites) to have to enter a
username or password, so I do not really want there to be a login at all. If
anyone can help me, I would appreciate it. Thanks.
--
Nathan Sokalski
(e-mail address removed)


TJS said:
for connection strings you can look here:

http://www.connectionstrings.com/


================================
http://www.ASPkey.net/
A Resource Site for Web Developers
*Free OnLine web Tools
*Free development services
================================


Nathan Sokalski said:
I recently downloaded and installed (hopefully correctly) MSDE 2000 Release
A. I previously, and still do, have the version of IIS that comes with XP
Professional installed on my computer. I wanted MSDE 2000 Release A so that
I could do database access using ASP from my websites, which are on my
computer. When I went to my first test website, I recieved the following
error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied
/testDB.asp, line 26

The ASP code that I used on my web to connect to the database (which is
currently just an empty text file) is the following:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL Server};" &_
"DBQ=" & Server.MapPath("testDB")

conn.Open connectstring

The error, obviously, is in the last line I have shown. Because I am
somewhat new to server setup, I am not sure what I need to do to make this
work. If anyone would be willing to help me, I would greatly appreciate it.
Thanks.
 
K

Kristofer Gafvert

As the error message tells you, you must grant IUSR_NJS logon rights to the
database.

--
Regards,
Kristofer Gafvert
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003


Nathan Sokalski said:
I think I am getting closer to my goal, but I am not sure where to go next.
My current error that I recieve is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'NJS\IUSR_NJS'.
/testDB.asp, line 25

(line 25 in my code is conn.Open connectstring)


And my current code for opening the connection is:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL
Server};Server=NJS;Database=pubs;Trusted_Connection=yes;"

conn.Open connectstring

(NJS is the name of my computer, I figured that is what I was supposed to
put there)
I am not sure what I am supposed to do to fix this problem, since there are
no user or password fields/attributes in the connection string, as well as
the fact that there is an attribute called "Trusted_Connection" . I also do
not want the user (even though it will normally only be me, since I
primarily want this only for testing my websites) to have to enter a
username or password, so I do not really want there to be a login at all. If
anyone can help me, I would appreciate it. Thanks.
--
Nathan Sokalski
(e-mail address removed)


TJS said:
for connection strings you can look here:

http://www.connectionstrings.com/


================================
http://www.ASPkey.net/
A Resource Site for Web Developers
*Free OnLine web Tools
*Free development services
================================


Nathan Sokalski said:
I recently downloaded and installed (hopefully correctly) MSDE 2000 Release
A. I previously, and still do, have the version of IIS that comes with XP
Professional installed on my computer. I wanted MSDE 2000 Release A so that
I could do database access using ASP from my websites, which are on my
computer. When I went to my first test website, I recieved the following
error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver]Neither DSN nor SERVER keyword supplied
/testDB.asp, line 26

The ASP code that I used on my web to connect to the database (which is
currently just an empty text file) is the following:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL Server};" &_
"DBQ=" & Server.MapPath("testDB")

conn.Open connectstring

The error, obviously, is in the last line I have shown. Because I am
somewhat new to server setup, I am not sure what I need to do to make this
work. If anyone would be willing to help me, I would greatly
appreciate
it.
 
B

Bob Barrows

Nathan said:
I think I am getting closer to my goal, but I am not sure where to go
next. My current error that I recieve is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'NJS\IUSR_NJS'.
/testDB.asp, line 25

(line 25 in my code is conn.Open connectstring)


And my current code for opening the connection is:

Set conn=Server.CreateObject("ADODB.Connection")
Set rs=Server.CreateObject("ADODB.Recordset")

connectstring="Driver={SQL
Server};Server=NJS;Database=pubs;Trusted_Connection=yes;"

conn.Open connectstring

(NJS is the name of my computer, I figured that is what I was
supposed to put there)
I am not sure what I am supposed to do to fix this problem, since
there are no user or password fields/attributes in the connection
string, as well as the fact that there is an attribute called
"Trusted_Connection" . I also do not want the user (even though it
will normally only be me, since I primarily want this only for
testing my websites) to have to enter a username or password, so I do
not really want there to be a login at all. If anyone can help me, I
would appreciate it. Thanks.


How many times do we have to advise you not to use ODBC? Have you even
looked at the websites that have been cited?

The easiest way to connect to SQL Server is to use a SQL login. The user
does not have to see or know the login and password. You can supply those in
your connection string. So your first step is to use Enterprise Manager to
create a SQL login and password (say you use asp_acct/password) and grant
that account permissions to the database to which you are attempting to
connect. You should read up in SQL Books Online (BOL) all that is has to say
about SQL security.

Then, in ASP, do this:

connectstring = "Provider-SQLOLEDB;Data Source=NJS;" & _
"Initial Catalog=pubs;User ID=asp_acct;Password=password"

That's it. You're done.
 
J

Jeff Cochran

I think I am getting closer to my goal, but I am not sure where to go next.

Limiting to a single appropriate newsgroup would be the smartest move.
Followups reste to just the inetserver.asp.db group. use it.
My current error that I recieve is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'NJS\IUSR_NJS'.

And what part of "Login Failed" are you questioning?

Create a login for the IUSR_NJS user in your database. or better,
create a SQL user, with appropriate rights, and use an OLEDB provider
string with the account in the string. Use an Include to make this
easy.

Jeff
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,180
Latest member
CryptoTax Software
Top