|
| |
|
|
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.
|
|
|
|
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.
|
|
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
|
|
|