navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
FrontPage Alternative
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Getrows musings

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Getrows musings
Page: [1]
 
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
Getrows musings - 1/14/2005 9:29:07   
I have been wondering....

Since Getrows uses an array, what if I have null values in fields in the first record that is returned? Does this mean that the array will have a smaller Ubound as it would if it was a normal array???

I say this because I'm having trouble with this exact situation and wondered if this could be the cause. I'm ok to try and sort it out on my own, I just couldn't find the answer to this little puzzler anywhere!
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Getrows musings - 1/14/2005 11:44:24   
If it returned a record (whether the fields were null or not), your ubound should not be bothered. An array is basically a table in memory and cells can have any value any other variable can have; null, int, text, boolean, etc.

Remember arrays are zero-based so the first row would be row 0 not row 1.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: Getrows musings - 1/14/2005 11:51:56   
Thanks for clearing that up. I've added a column to be returned in a select statement and changed the WHERE clause to return a record that I know has a value in that column, but the Ubound has stayed the same. I'll keep looking, as I'm not sure what's going on - but if I don't crack it I will be back!:)

(in reply to rdouglass)
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Getrows musings - 1/14/2005 13:10:25   
I have a page I use to confirm all the data I am returning to my array. Pop this code on an ASP page by itself; change the connection and query, and browse to it. It basically dumps the array grabbed by getrows into a table.

It may shed some light on what is actually being returned.

<html>

<head>
<title>GetRows Test</title>
</head>

<body>
<%
Dim arrDBData, conntemp, I, J, rstemp
Dim iRecFirst, iRecLast, iFieldFirst, iFieldLast

Set conntemp = Server.CreateObject("ADODB.Connection")

' Change this line for your database depending on connection:
conntemp.Open "DSN=xxxx;uid=xxx;pwd=xxx;database=xxxx"

' Change this line for your table or query:
Set rstemp = conntemp.Execute("SELECT * FROM tblUsers")

arrDBData = rstemp.GetRows()

rstemp.Close
Set rstemp = Nothing
conntemp.Close
Set conntemp = Nothing

iRecFirst   = LBound(arrDBData, 2)
iRecLast    = UBound(arrDBData, 2)
iFieldFirst = LBound(arrDBData, 1)
iFieldLast  = UBound(arrDBData, 1)

%>
<table border="1">
<%For I = iRecFirst To iRecLast
	Response.Write "<tr>" & vbCrLf
	For J = iFieldFirst To iFieldLast
		Response.Write vbTab & "<td>" & arrDBData(J, I) & "</td>" & vbCrLf
	Next
	
	Response.Write "</tr>" & vbCrLf
Next%>
</table>
</body>

</html>


_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: Getrows musings - 1/17/2005 6:08:28   
Thanks for that - got it sorted and realized I still wasn't pulling the right stuff out of the database anyway! The joys of computing:)

(in reply to rdouglass)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Getrows musings
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts