Print Page | Close Window

ASP memory leak??? Disappearing fields?? plz help!

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=24815
Printed Date: 29 March 2026 at 10:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ASP memory leak??? Disappearing fields?? plz help!
Posted By: FLATLINE
Subject: ASP memory leak??? Disappearing fields?? plz help!
Date Posted: 12 November 2007 at 10:33pm
Hi,

I have a really bizare problem in ASP while querying data from an MSSQLServer database.

The problem is that sometimes when trying to get field values from a recordset, the value is empty in ASP, eventhough it's not in the database.
It's pretty random, but I noticed that this is affected by the order in which I get the fields from the recordset.

For instance, in the example below:

rsDataSet.Open strSQL, adoCn
Response.Write("test 1: " & rsDataSet("col1") & "<br>")
Response.Write("test 2: " & rsDataSet("col2") & "<br>")
Response.Write("test 3: " & rsDataSet("col3") & "<br>")

Test 1 will always show me the value in col1.
But sometimes I can't see the values in col2 and col3 (they're empty, but I remind you, they're NOT empty in the database).
But if I do this:

Response.Write("test 2: " & rsDataSet("col2") & "<br>")
Response.Write("test 3: " & rsDataSet("col3") & "<br>")
Response.Write("test 1: " & rsDataSet("col1") & "<br>")

Then I can see the value in col2, but I won't see the value in col1 anymore.

However, string valued fields usually work, I found this problem quite consistent with non-string fields (numeric and boolean mostly).
Usually I would also try to get a string value field somewhere in the middle, and it would work, and some numeric fields may even work once in a while, but others won't. It's hard to describe, it just seems so random... :(
But no matter what, the first field I get always works.

My guess is that this is some kind of a memory leak.

Can anyone help?


-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ



Replies:
Posted By: shakir
Date Posted: 17 November 2007 at 8:39am
try to view all colms in one row and test it


Posted By: FLATLINE
Date Posted: 17 November 2007 at 3:00pm
What do you mean in one row? One HTML row? Why would that help?
Anyways, what I wrote was only an example. In my original code I saved the columns in variables.


-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ


Posted By: MadDog
Date Posted: 18 November 2007 at 8:08am
You say you are having problems and a "memory leak" but you only posted a few lines of code.

Your problem is must likely you dont close your database connections and your code is poorly written so your having problems with it.


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: FLATLINE
Date Posted: 18 November 2007 at 6:53pm
Dude, the "bad code" is the web wiz forum...

-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ


Posted By: MadDog
Date Posted: 18 November 2007 at 8:22pm
Web Wiz Forum isnt bad code.

Are you using the database of Web Wiz Forum and using your own code tp pull records?


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: FLATLINE
Date Posted: 19 November 2007 at 5:45pm

Not exactly. Originaly I was using the web wiz forum access database.
After a while I upgraded the database to MSSQL (used the export feature of access).

Also, I've made some changes to the database (added a few new fields to the Authors table), so I had to update the code as well to get those new fields for the page.

You think that could be the reason? It seems kinda far-fetched to me. It's not like it's my first time developing ASP, I know how to get fields out of a database...


-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ


Posted By: WebWiz-Bruce
Date Posted: 20 November 2007 at 9:18am
What driver are you using to connect to your SQL Server database using adoCn?


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: FLATLINE
Date Posted: 20 November 2007 at 4:52pm
DSN ODBC...

-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ


Posted By: WebWiz-Bruce
Date Posted: 20 November 2007 at 5:12pm
I have found very strange and unpredictable results with recordsets before just like you mention when using the ODBC driver with SQL Server.

This is why always avoid this driver driver and use the SQL OLE DB driver instead with a DSN-less connection. Do a search on Google for Provider=SQLOLEDB to get the exact driver string you need.

The OLE DB driver is also faster, and DSN-less connections are also faster, so this combination would be faster and more stable.


-------------
https://www.webwiz.net/web-wiz-forums/forum-hosting.htm" rel="nofollow - Web Wiz Forums Hosting
https://www.webwiz.net/web-hosting/windows-web-hosting.htm" rel="nofollow - ASP.NET Web Hosting


Posted By: MadDog
Date Posted: 20 November 2007 at 5:16pm
SQLOLEDB connection string:
"Provider=SQLOLEDB;Server=localhost;User ID=DBUsername;Password=DBPassword;Database=DBName";"


-------------
http://www.iportalx.net" rel="nofollow">


Posted By: FLATLINE
Date Posted: 21 November 2007 at 7:36pm
I see. Well that's quite a bummer. I hoped I could use DSN connections for more ease and integrity... Guess it's back to the whiteboard.
 
Thanks for your help borg, you're the best Thumbs%20Up


-------------
Visit my site: http://darkgreen.service-club.net - DarkGreen HQ



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net