473,584 Members | 2,860 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Difference between getrows and getstring


What is the difference, and when to use one over the other?

Thanks
Jul 19 '05 #1
11 5016
GetRows() is typically used when you still need to do row-by-row processing,
or you need to refer to certain members in the set individually.

GetString() is useful when you need a formatted string that has simple
determinations for what goes between a "row" and "column" (e.g. not too much
complex iteration or conditional logic, like when alternating row colors for
display)... see one usage here: http://www.aspfaq.com/2482

For more comparison stuff, see http://www.aspfaq.com/2467

A

"Crane Linkledder" <Li********@NOT ADOMAIN.com> wrote in message
news:uL******** ******@TK2MSFTN GP11.phx.gbl...

What is the difference, and when to use one over the other?

Thanks

Jul 19 '05 #2
GetRows returns a two dimensional array of the recordset. GetString returns
your records all concatenated together with some other text in between, if
you choose.

http://msdn.microsoft.com/library/en...damth02_10.asp
http://msdn.microsoft.com/library/en...damth02_11.asp

Ray at work

"Crane Linkledder" <Li********@NOT ADOMAIN.com> wrote in message
news:uL******** ******@TK2MSFTN GP11.phx.gbl...

What is the difference, and when to use one over the other?

Thanks

Jul 19 '05 #3


Thanks to the both of you. One last question. When using getrows, is it
possible to exclude specific columns?

I am selecting more columns in my SELECT statement than I'd like to display
on screen. How can I filter them out?

Thanks


"Crane Linkledder" <Li********@NOT ADOMAIN.com> wrote in message
news:uL******** ******@TK2MSFTN GP11.phx.gbl...

What is the difference, and when to use one over the other?

Thanks

Jul 19 '05 #4
Crane Linkledder wrote:
Thanks to the both of you. One last question. When using getrows, is
it possible to exclude specific columns?

The documentation is here:
http://msdn.microsoft.com/library/en...damth02_10.asp

As you will see, you can supply an " ... array of field names or ordinal
position numbers" in the third argument. So if you wanted to only use the
first, third and fifth fields in the recordset, you could do this:

arResults = rs.GetRows(,,ar ray(0,2,4))

The MSDN Library is your friend.

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #5
I'm sorry. I meant getString. Is this true with getString also?
"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:uF******** ******@TK2MSFTN GP12.phx.gbl...
Crane Linkledder wrote:
Thanks to the both of you. One last question. When using getrows, is
it possible to exclude specific columns?

The documentation is here:
http://msdn.microsoft.com/library/en...damth02_10.asp

As you will see, you can supply an " ... array of field names or ordinal
position numbers" in the third argument. So if you wanted to only use the
first, third and fifth fields in the recordset, you could do this:

arResults = rs.GetRows(,,ar ray(0,2,4))

The MSDN Library is your friend.

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #6
"Crane Linkledder" <Li********@NOT ADOMAIN.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I'm sorry. I meant getString. Is this true with getString also?
"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:uF******** ******@TK2MSFTN GP12.phx.gbl...
Crane Linkledder wrote:
Thanks to the both of you. One last question. When using getrows, is it possible to exclude specific columns?

The documentation is here:
http://msdn.microsoft.com/library/en...damth02_10.asp

As you will see, you can supply an " ... array of field names or ordinal position numbers" in the third argument. So if you wanted to only use the first, third and fifth fields in the recordset, you could do this:

arResults = rs.GetRows(,,ar ray(0,2,4))


No, there is no parameter for the GetString method that corresponds to
the Fields parameter in the GetRows method. However, I'll bet
dollars-to-donuts that if you provide the sql statement we can "hide"
the fields you don't need.

HTH
-Chris Hohmann
Jul 19 '05 #7
It says-
Variant = recordset.GetSt ring(StringForm at, NumRows, ColumnDelimiter ,
RowDelimiter, NullExpr)
It does not look like it is possible to filter out columns using getString.
How can I get around this?TIA

"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:uF******** ******@TK2MSFTN GP12.phx.gbl...
Crane Linkledder wrote:
Thanks to the both of you. One last question. When using getrows, is
it possible to exclude specific columns?

The documentation is here:
http://msdn.microsoft.com/library/en...damth02_10.asp

As you will see, you can supply an " ... array of field names or ordinal
position numbers" in the third argument. So if you wanted to only use the
first, third and fifth fields in the recordset, you could do this:

arResults = rs.GetRows(,,ar ray(0,2,4))

The MSDN Library is your friend.

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Jul 19 '05 #8
Thank you. I was starting to panic.
Here is my statement-

SQL = "SELECT " & users & ".one, " & users & ".two,
"&calendar&".ap pointmentStart, "&calendar&".ap pointmentEnd, "&calendar&".ID ,
"&calendar&".ow nerID, "&calendar&".cl ientID, " & users & ".userID " &_
"FROM "&calendar& ", " & users & " " &_
"WHERE "&users&".userI D = "&calendar&".cl ientID " &_
" AND recurring = '0' ORDER BY appointmentStar t"
I am trying to avoid displaying-

calendar&".owne rID "
calendar&".clie ntID "
users & ".userID "



"Chris Hohmann" <no****@thankyo u.com> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. ..
"Crane Linkledder" <Li********@NOT ADOMAIN.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
I'm sorry. I meant getString. Is this true with getString also?
"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:uF******** ******@TK2MSFTN GP12.phx.gbl...
Crane Linkledder wrote:
> Thanks to the both of you. One last question. When using getrows, is > it possible to exclude specific columns?
>
The documentation is here:
http://msdn.microsoft.com/library/en...damth02_10.asp

As you will see, you can supply an " ... array of field names or ordinal position numbers" in the third argument. So if you wanted to only use the first, third and fifth fields in the recordset, you could do this:

arResults = rs.GetRows(,,ar ray(0,2,4))


No, there is no parameter for the GetString method that corresponds to
the Fields parameter in the GetRows method. However, I'll bet
dollars-to-donuts that if you provide the sql statement we can "hide"
the fields you don't need.

HTH
-Chris Hohmann

Jul 19 '05 #9
Crane Linkledder wrote:
Thank you. I was starting to panic.
Here is my statement-

SQL = "SELECT " & users & ".one, " & users & ".two,
"&calendar&".ap pointmentStart, "&calendar&".ap pointmentEnd,
"&calendar&".ID , "&calendar&".ow nerID, "&calendar&".cl ientID, " &
users & ".userID " &_ "FROM "&calendar& ", " & users & " " &_
"WHERE "&users&".userI D = "&calendar&".cl ientID " &_
" AND recurring = '0' ORDER BY appointmentStar t"
I am trying to avoid displaying-

calendar&".owne rID "
calendar&".clie ntID "
users & ".userID "

Why retrieve the fields at all if you don't want to display them?

Are you doing something else with their contents behind the scenes? If so,
you will need to go with the GetRows solution.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
8169
by: Croney69 | last post by:
I am getting information out of a table to place into to an Array. rs=DataConn.Execute(strSQL) At this point I place it into the array objArray=rs.GetRows() But how do I handle things if the rs came back blank?
11
3509
by: Laphan | last post by:
Hi All I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as possible. My problem is that I can't seem to use this to complete good effect because the IsArray statement doesn't seem to work with a local var...
9
3654
by: bajopalabra | last post by:
hi session("myVar") = rs.getRows( ) don't work when number of records is greater than 10 does anybody know WHY ??? is it a Session object limitation ??? thanks
5
4648
by: Alan Howard | last post by:
We're getting "ERROR (0x8007000E) Not enough storage is available to complete this operation" errors on a fairly large, busy ASP/SQL Server web site. The error is being thrown on a line calling oRs.GetRows() on one of our busiest pages. The array returned from the GetRows() call will be 'cleaned up' when the page goes out of scope, but I...
10
26296
by: Hank | last post by:
Hello, I'm having trouble reading from a table directly into an array using Access 2000. Dim db As Database Dim rsTime As Recordset Dim TimeArray As Variant Set db = CurrentDb Set rsTime = db.OpenRecordset("Time Record")
3
3104
by: colm1974 | last post by:
Hi, I hope somebody can help. I have been trying to use the GetRows method but it only seems to work when there are no constants assigned. aGetElement = rs_zgl_element.GetRows() This works and I can select any array element I need from aGetElement. I can use Lbound, Ubound etc etc. In this case the recordset has in effect 2 columns and 197...
1
2735
by: FrozenDude | last post by:
Help! I'm a VBA newbie and am having trouble getting the array values retrieved from getRows into a series of individual variables. Here is the query: "Select parcelID, DueDate from tablename" I have the array populated with getRows and have the number of returned rows. I need to loop through the array - somehow - and assign the tow...
9
35416
ADezii
by: ADezii | last post by:
One question which pops up frequently here at TheScripts is: 'How do I retrieve data from a Recordset once I've created it?' One very efficient, and not that often used approach, is the GetRows() Method of the Recordset Object. This Method varies slightly from DAO to ADO, so for purposes of this discussion, we'll be talking about DAO Recordsets....
3
43462
ADezii
by: ADezii | last post by:
Last Tip, we demonstrated the technique for retrieving data from a DAO Recordset, and placing it into a 2-dimensional Array using the GetRows() Method. This week, we will cover the same exact Method (GetRows()), but only as it applies to an ADO Recordset. Although there are similarities in the 2 methodologies, the ADO Method offers 2 more Optional...
0
7897
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7829
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8189
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7940
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8198
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6587
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5379
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3850
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.