Wrox Programmer Forums
|
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 May 25th, 2004, 11:12 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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 May 25th, 2004, 04:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Strive for Perfection
 
Old May 26th, 2004, 03:36 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 May 26th, 2004, 08:02 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

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 May 26th, 2004, 12:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
Strive for Perfection
 
Old May 27th, 2004, 04:33 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I'll try it out!

 
Old May 27th, 2004, 05:05 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 May 27th, 2004, 09:43 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

How about posting your code for those two pages that crash your app?

 
Old May 27th, 2004, 11:11 AM
Authorized User
 
Join Date: Jul 2003
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 May 27th, 2004, 01:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Doesn't look like SQL server related. I am puzzled.

_________________________
-Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server does not exist or access denied happygv SQL Server 2000 0 April 9th, 2008 02:27 AM
SQL Server does not exist or access denied jennypretty Classic ASP Databases 3 May 18th, 2007 11:43 AM
SQL Server does not exist or access denied. jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 November 3rd, 2004 08:51 AM
SQL Server does not exist or access denied rj1406 ASP.NET 1.0 and 1.1 Basics 1 September 16th, 2004 08:58 PM
SQL Server does not exist or access denied. nitinmailbox All Other Wrox Books 1 June 25th, 2003 06:35 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.