473,414 Members | 1,605 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,414 software developers and data experts.

Classic ASP connection to SQL Server 2005

3
We are using a dedicated Windows 2003 machine running IIS 6.0 and SQL Server 2005 (on the same machine). 1 CPU, 2GB RAM. SQL Server set to 1GB max memory. Our code is Classic ASP and recently our server became unresponsive during busy hours where only about 50 requests would execute (with long delay) and the rest would time out. For the site visitors the experience is a hung service with no response. We are new on this dedicated server (and used to be on a shared environment with IIS 6.0 and an older version of SQL Server 2000 on a separate shared machine)

We want to make sure that there is no memory leak driven by our code and we've checked line by line to make sure that we are closing all connections and destroying objects. However, we also would like to validate the method we connect to the SQL database and would like the help of the community here. Below is the code we are using to connect and would appreciate if someone can skim over it and tell us we we should be doing something differently:

Expand|Select|Wrap|Line Numbers
  1. <%
  2.  Function glpCloseRst(objRst)
  3.   If IsObject(objRst) Then
  4.    If objRst.State = 1 Then
  5.     objRst.Close
  6.     Set objRst = Nothing
  7.    End If
  8.   End If
  9.  End Function
  10.  
  11.  Function glpCloseDBConn (objDBConn)
  12.   If IsObject(objDBConn) Then
  13.    If objDBConn.State = 1 Then
  14.     objDBConn.Close
  15.     Set objDBConn = Nothing
  16.    End If
  17.   End If
  18.  End Function
  19. %>
  20.  
  21. <%
  22. ConnectionStrSQL = "Driver={SQL Native Client};Server=555.55.555.55;Database=dbname;Uid=username;Pwd=password;"
  23. set connSQL = CreateObject("ADODB.Connection") 
  24. connSQL.open ConnectionStrSQL
  25. %>
  26.  
  27. <%
  28. Dim allSQX
  29. allSQLX = "SELECT * FROM TABLE WHERE id='something';" 
  30.  
  31. Dim allRsX
  32. Set allRsX = Server.CreateObject("ADODB.Recordset")
  33. allRsX.Open allSQLX, connSQL, 3, 3
  34.  
  35. DO UNTIL allRsX.eof 
  36.  
  37.   ...somestuff...
  38.  
  39. allRsX.movenext
  40. LOOP
  41.  
  42. glpCloseRst(allRsX)
  43. glpCloseDBConn(connSQL)
  44. %>
Thank you!
Jan 11 '08 #1
1 4421
SQL Server 2005 has many editions. The free edition works on 1 CPU, max 2GB storage and limited updates/connections. I'm not sure but it is something about 50. So maybe the problem is not the sourch code, but the restrictions of your MS SQL2005 edition.

Hope that will help.
Jan 23 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
by: Danieltbt05 | last post by:
just installed SQL server 2000 and using my client , i can't locate the server. I used SQL query analyzer to search but no servers were found. Error message is as below Server : Msg17,level...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
3
by: MartyNg | last post by:
I have been looking online for pointers, and read mixed things. I was hoping if I post direct questions here, I could get some solid answers. I work for a small company with less than 10 web...
6
by: John | last post by:
Hello. I believe I've read somewhere that classic .asp pages will still operate correctly with no problems with the .NET 1.1 framework installed on a Windows 2000 Server server. Does anyone know...
0
by: DariuszK | last post by:
I am greeting I would like to consult the better solution(with security consideration) to the access is for MSSQL(2005) from ASP(Classic) in the system of the intranet. a) SQL mixed mode and...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
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...
0
by: Judge Garth | last post by:
With classic ADO you could attach a ReturnValue parameter to a command containing inline parameters. I didn't add any OTHER parameter objects to do so, The entire command was in the CommandText. The...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.