![](../images/header/spacer.gif) |
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
![Old](../images/statusicon/post_old.gif)
May 25th, 2004, 11:12 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
SQL Server does not exist or access denied
Hi,
I have ASP pages accessing a SQL Server 2000 database. The pages are running on IIS 5.0
Every now and then access to the database from these pages is denied resulting in the error
SQL Server does not exist or access denied
Other ASP/HTML pages that don't access the database continue to run OK and I can connect to the database outside of the ASP pages. The database looks fine.
To clear up this problem I have to restart IIS. I've noticed that this always happens after a specific 2 ASP pages have been hit. These pages do not access the database but take somewhat longer than the average page to run.
I have searched high and low for any clues as to why this is happening and so far no luck.
Has anyone any ideas?
|
![Old](../images/statusicon/post_old.gif)
May 25th, 2004, 04:25 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Where is the SQL server installed? Is it running on the same box that runs IIS or on a different box? What is the connection string that you have used? Can you show some code of that?
_________________________
-Vijay G
![8ball](../images/smilies/8ball.gif) Strive for Perfection ![8ball](../images/smilies/8ball.gif)
|
![Old](../images/statusicon/post_old.gif)
May 26th, 2004, 03:36 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
No the SQL Server is on a different box.
The connection string is
Set DBConn = server.CreateObject("ADODB.Connection")
DBConn.Open "Driver={SQL Server}; Server=ServerName; Database=DatabaseName; UID=dbuser; PWD=dbpass"
|
![Old](../images/statusicon/post_old.gif)
May 26th, 2004, 08:02 AM
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Here's the connection string that I use and never have any problems with it. Not sure if that is what the source of your problem is though.
set DBConn = server.createobject("adodb.connection")
DBConn.connectionString = "provider=sqloledb.1; user id=dbuser; password=dbpass; data source=ServerName; initial catalog=DatabaseName"
DBConn.mode=3
DBConn.cursorlocation=3
DBConn.open
|
The Following User Says Thank You to DaveGerard For This Useful Post:
|
|
![Old](../images/statusicon/post_old.gif)
May 26th, 2004, 12:42 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
haidee_mccaffrey,
I think you are using ODBC Connection there.
Please change that to standard OLEDB connection string as DaveGerard suggested, You can go ahead to change that in your connection string like this.
Eg: "Provider=sqloledb;Data Source=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
If you want you might to take a look at this http://www.connectionstrings.com
Hope that helps.
_________________________
-Vijay G
![8ball](../images/smilies/8ball.gif) Strive for Perfection ![8ball](../images/smilies/8ball.gif)
|
![Old](../images/statusicon/post_old.gif)
May 27th, 2004, 04:33 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks, I'll try it out!
|
![Old](../images/statusicon/post_old.gif)
May 27th, 2004, 05:05 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unfortunately guys, this didn't do the job!
I set up a test asp page with the new connection string, ran the suspect asp page and yep, my test page bombed out, giving the following message,
Microsoft OLE DB Provider for SQL Server (0x80004005)
[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.
I have to restart the IIS server to get the test page to run again. Wierd!
Do you think it could have anything to do with ASP queue lengths?
|
![Old](../images/statusicon/post_old.gif)
May 27th, 2004, 09:43 AM
|
Friend of Wrox
|
|
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
|
|
How about posting your code for those two pages that crash your app?
|
![Old](../images/statusicon/post_old.gif)
May 27th, 2004, 11:11 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ok it goes like this,
I have a custom built dll that connects to one of our machine using winsock.dll
It accepts in a command and writes data back to the web page.
Dim x
Set x = Server.CreateObject("CIMCmdSocket.CmdSocket")
x.opensocket(SocketNumber)
If ( x.Connected ) Then
Dim istatus
Dim ReplyStr
Dim CommandStr
CommandStr = "ADDDCOP"
x.WriteToSocket (CommandStr)
iStatus = x.ReadFromSocket(ReplyStr)
Response.Write("<p>")
Response.Write(ReplyStr)
Response.Write("</p>")
x.DeleteSocket
Else
' Output error message
End If
Set x = Nothing
|
![Old](../images/statusicon/post_old.gif)
May 27th, 2004, 01:42 PM
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Doesn't look like SQL server related. I am puzzled.
_________________________
-Vijay G
![8ball](../images/smilies/8ball.gif) Strive for Perfection ![8ball](../images/smilies/8ball.gif)
|
|
![](../images/header/spacer.gif) |