473,748 Members | 10,539 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 5031
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
8177
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
3518
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 array that has or has not been populated with the .getRows() property.
9
3661
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
4654
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 wonder if we should be calling Erase specifically after the last usage to explicitly free allocated...
10
26312
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
3110
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 rows. Column names are converted (int), name (varchar). aGetElement =...
1
2742
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 field to variavles numParcelID and newDuedate respectively so I can use
9
35534
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. The ADO approach will be addressed in the following Tip. We'll be using a Query, consisting of 5...
3
43524
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 Arguments, is a little more complex, and of course, the syntax is different in creating the...
0
8991
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9548
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9325
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9249
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6076
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4876
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2787
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.