If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Recordset Object Losing Values, other oddities

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-05-03, 18:42
Weevil Weevil is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
Question Recordset Object Losing Values, other oddities

I'm building a simple front-end to a meta database that I have using old style ASP and JavaScript. Something has gone way haywire and I can't figure out what it is.

Seems if you retrieve a Recordset object and then start accessing some of the fields, other fields will lose their values. For example, I pull back a Recordset with a bunch of id's, names, and descriptions in it. If I use the name and the id to create a unique name for a field (Recordset.Fields("name") + "-" + Recordset.Fields("id")), then try to access the description field later, it will be empty undefined - in ALL rows.

Another oddity I'm noticing is that the for...in syntax is no longer working. I can't traverse ServerVariables or Request.Form fields with using a for...next loop instead. No error is thrown, but no results are retrieved, either.

I'm not sure when the trouble started - seems like it might have been when I tried to use ASP.NET to build this app (too much trouble to learn it for this little app). I've tried uninstalling it (aspnet_regiis.exe -ua), but I still get the same behavior. It's almost like the script host is buggered up or something.

This is a very fresh Windows XP Pro install (recovering from a very hard disk crash), so it should be pretty clean. .NET Framework 1.1, Microsoft SQL Server 2000 SP3, Visual Interdev 6.0 (although I just noticed I didn't put SP5 in - maybe that will fix it).

Anyway, it's just plain weird and I wondered if anyone else had seen it. I'll try the service pack and see if that makes any difference.

[EDIT] It was a little naive to think that the SP would make any difference, but I'm clutching at straws here.

Last edited by Weevil; 08-05-03 at 18:51.
Reply With Quote
  #2 (permalink)  
Old 08-06-03, 05:06
aliayen aliayen is offline
Registered User
 
Join Date: Aug 2003
Location: Kayseri-Turkiye
Posts: 7
I can offer to use the GetRows method.

Is this code working on your system:?

Code:
<%
	function ForInDemo()
	{
	// Create some variables.
	var a, key, s = "";
	// Initialize object.
	a = {"a" : "Athens" , "b" : "Belgrade", "c" : "Cairo"}
	// Iterate the properties.
	for (key in a)
	{
		s += key + " " + a[key] + "<BR>";
	}
	return(s);
	}
	
	Response.Write(ForInDemo());
%>
Reply With Quote
  #3 (permalink)  
Old 08-06-03, 07:20
Weevil Weevil is offline
Registered User
 
Join Date: Aug 2003
Posts: 2
Quote:
[SIZE=1]Originally posted by aliayen
I can offer to use the GetRows method.
I tried using GetRows() yesterday... all I got was an undefined array.

I haven't been able to get for...in to work on any object.

Something is seriously screwed on my system. I finally just ditched it all, installed Apache and started converting it to PHP. I took out IIS so Apache could have port 80, so I can't run any additional tests at the moment. Maybe if I reinstall it, it will mend itself. We'll see. The PHP is coming along quite quickly, so I may not bother trying to diagnose the problem.

I have not tested to see if for...in syntax works in client side JavaScript. That might give me a clue as to whether it's in the script host, or if it's a problem with the way ASP is accessing its variables.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On