Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP memory leak??? Disappearing fields?? plz help!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

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

 Post Reply Post Reply Page  12>
Author
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post Topic: ASP memory leak??? Disappearing fields?? plz help!
    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?


Edited by FLATLINE - 14 November 2007 at 9:43pm
Visit my site: DarkGreen HQ
Back to Top
shakir View Drop Down
Groupie
Groupie


Joined: 08 November 2007
Location: Saudi Arabia
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote shakir Quote  Post ReplyReply Direct Link To This Post Posted: 17 November 2007 at 8:39am
try to view all colms in one row and test it
Back to Top
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post 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: DarkGreen HQ
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post Posted: 18 November 2007 at 6:53pm
Dude, the "bad code" is the web wiz forum...
Visit my site: DarkGreen HQ
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
FLATLINE View Drop Down
Groupie
Groupie
Avatar

Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
Post Options Post Options   Thanks (0) Thanks(0)   Quote FLATLINE Quote  Post ReplyReply Direct Link To This Post 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: DarkGreen HQ
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 20 November 2007 at 9:18am
What driver are you using to connect to your SQL Server database using adoCn?
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.