| Author |
Topic Search Topic Options
|
FLATLINE
Groupie
Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
|
Post Options
Thanks(0)
Quote Reply
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
|
|
|
 |
shakir
Groupie
Joined: 08 November 2007
Location: Saudi Arabia
Status: Offline
Points: 41
|
Post Options
Thanks(0)
Quote Reply
Posted: 17 November 2007 at 8:39am |
|
try to view all colms in one row and test it
|
 |
FLATLINE
Groupie
Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
MadDog
Mod Builder Group
Joined: 01 January 2002
Status: Offline
Points: 3008
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
FLATLINE
Groupie
Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
|
Post Options
Thanks(0)
Quote Reply
Posted: 18 November 2007 at 6:53pm |
|
Dude, the "bad code" is the web wiz forum...
|
|
|
 |
MadDog
Mod Builder Group
Joined: 01 January 2002
Status: Offline
Points: 3008
|
Post Options
Thanks(0)
Quote Reply
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?
|
|
|
 |
FLATLINE
Groupie
Joined: 08 July 2002
Location: Israel
Status: Offline
Points: 142
|
Post Options
Thanks(0)
Quote Reply
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...
|
|
|
 |
WebWiz-Bruce
Admin Group
Web Wiz Developer
Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
|
Post Options
Thanks(0)
Quote Reply
Posted: 20 November 2007 at 9:18am |
|
What driver are you using to connect to your SQL Server database using adoCn?
|
|
|
 |