473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Closest method to a VBA recordset

Rob
Hi

Remember back in VBA, you could easily create a recordset, loop thru the
rows, and store the values of the columns to variables...

I am not even talking about writing back to the data...

It looks to me like I can use a forward only "datareader" which appears to
store a whole row of data into one long string, which I would then have to
use some parsing method in order to determine the value of a specific column
of data.

Or...

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load and
loop thru it....

Is there some easier method to simply loop thru a block of data and return
the value of a column name I specifiy ?
Apr 18 '07 #1
10 1943
"Rob" <ro***@yahoo.comwrote in
news:Ip******************************@comcast.com:
It looks to me like I can use a forward only "datareader" which
appears to store a whole row of data into one long string, which I
would then have to use some parsing method in order to determine the
value of a specific column of data.
No, you can access the individual columns by going:

DataReader("ColumnName") OR DataReader(ColumnIndex)

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load
and loop thru it....
Or just the datatable.
Is there some easier method to simply loop thru a block of data and
return the value of a column name I specifiy ?
Take a closer look at DataReader and DataSets ;-)
Apr 18 '07 #2
sorry life used to be much much simpler

now you've got to have a seperate connection per datareader; you can't
reuse a connection for really anything-- because ADO.net tries to help
out and automagically close any connection _EVER_ for no reason

MS screwed us all with .NET; it is best to stick with VBA until the
new version of Visual Fred comes out soon
I love Access Data Projects more than anything


On Apr 18, 2:11 pm, "Rob" <r...@yahoo.comwrote:
Hi

Remember back in VBA, you could easily create a recordset, loop thru the
rows, and store the values of the columns to variables...

I am not even talking about writing back to the data...

It looks to me like I can use a forward only "datareader" which appears to
store a whole row of data into one long string, which I would then have to
use some parsing method in order to determine the value of a specific column
of data.

Or...

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load and
loop thru it....

Is there some easier method to simply loop thru a block of data and return
the value of a column name I specifiy ?

Apr 18 '07 #3
Rob
Ahhh, I see...

DataReader("ColumnName") with a ".ToString" added does work fine

Thanks a Bunch !
"Spam Catcher" <sp**********@rogers.comwrote in message
news:Xn**********************************@127.0.0. 1...
"Rob" <ro***@yahoo.comwrote in
news:Ip******************************@comcast.com:
>It looks to me like I can use a forward only "datareader" which
appears to store a whole row of data into one long string, which I
would then have to use some parsing method in order to determine the
value of a specific column of data.

No, you can access the individual columns by going:

DataReader("ColumnName") OR DataReader(ColumnIndex)

>I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load
and loop thru it....

Or just the datatable.
>Is there some easier method to simply loop thru a block of data and
return the value of a column name I specifiy ?

Take a closer look at DataReader and DataSets ;-)

Apr 18 '07 #4
Rob,

In my opinion is the DataTable almost 1:1 the recordset.

The first record is by instance
dt.rows(0)
The next record is
dt.rows(current + 1)
The last record is
dt.rows(rows.count -1)

Cor

"Rob" <ro***@yahoo.comschreef in bericht
news:Ip******************************@comcast.com. ..
Hi

Remember back in VBA, you could easily create a recordset, loop thru the
rows, and store the values of the columns to variables...

I am not even talking about writing back to the data...

It looks to me like I can use a forward only "datareader" which appears to
store a whole row of data into one long string, which I would then have to
use some parsing method in order to determine the value of a specific
column of data.

Or...

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load and
loop thru it....

Is there some easier method to simply loop thru a block of data and return
the value of a column name I specifiy ?

Apr 19 '07 #5
Cor Ligthert [MVP] wrote:
Rob,

In my opinion is the DataTable almost 1:1 the recordset.
In my opinion a DataReader is much closer to a Recordset than a
DataTable is.

A DataTable is used for holding the data read from a DataReader, it
doesn't read anything from the database by itself. A Recordset doesn't
contain the data, but reads it from the database, just like a DataReader.

A DataReader is similar to a forward-only Recordset.
A DataTable is similar to a disconnected Recordset.
>
The first record is by instance
dt.rows(0)
The next record is
dt.rows(current + 1)
The last record is
dt.rows(rows.count -1)

Cor

"Rob" <ro***@yahoo.comschreef in bericht
news:Ip******************************@comcast.com. ..
>Hi

Remember back in VBA, you could easily create a recordset, loop thru the
rows, and store the values of the columns to variables...

I am not even talking about writing back to the data...

It looks to me like I can use a forward only "datareader" which appears to
store a whole row of data into one long string, which I would then have to
use some parsing method in order to determine the value of a specific
column of data.

Or...

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load and
loop thru it....

Is there some easier method to simply loop thru a block of data and return
the value of a column name I specifiy ?


--
Göran Andersson
_____
http://www.guffa.com
Apr 19 '07 #6
Goran,

You are free in your opinion, do you mind if I keep mine?

Cor

"Göran Andersson" <gu***@guffa.comschreef in bericht
news:eO**************@TK2MSFTNGP02.phx.gbl...
Cor Ligthert [MVP] wrote:
>Rob,

In my opinion is the DataTable almost 1:1 the recordset.

In my opinion a DataReader is much closer to a Recordset than a DataTable
is.

A DataTable is used for holding the data read from a DataReader, it
doesn't read anything from the database by itself. A Recordset doesn't
contain the data, but reads it from the database, just like a DataReader.

A DataReader is similar to a forward-only Recordset.
A DataTable is similar to a disconnected Recordset.
>>
The first record is by instance
dt.rows(0)
The next record is
dt.rows(current + 1)
The last record is
dt.rows(rows.count -1)

Cor

"Rob" <ro***@yahoo.comschreef in bericht
news:Ip******************************@comcast.com ...
>>Hi

Remember back in VBA, you could easily create a recordset, loop thru the
rows, and store the values of the columns to variables...

I am not even talking about writing back to the data...

It looks to me like I can use a forward only "datareader" which appears
to store a whole row of data into one long string, which I would then
have to use some parsing method in order to determine the value of a
specific column of data.

Or...

I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load and
loop thru it....

Is there some easier method to simply loop thru a block of data and
return the value of a column name I specifiy ?



--
Göran Andersson
_____
http://www.guffa.com

Apr 19 '07 #7
yeah... except you _STILL_ can't have multiple active DataReaders on
the same connection... even though Microsoft tried to CON us all into
buying SQL 2005-- so that we could use 'Multiple Active Result Sets'

I call BULLSHIT on microsoft, fix ADO.net it sucks balls compared to
ADO Classic


On Apr 18, 3:11 pm, "Rob" <r...@yahoo.comwrote:
Ahhh, I see...

DataReader("ColumnName") with a ".ToString" added does work fine

Thanks a Bunch !

"Spam Catcher" <spamhoney...@rogers.comwrote in message

news:Xn**********************************@127.0.0. 1...
"Rob" <r...@yahoo.comwrote in
news:Ip******************************@comcast.com:
It looks to me like I can use a forward only "datareader" which
appears to store a whole row of data into one long string, which I
would then have to use some parsing method in order to determine the
value of a specific column of data.
No, you can access the individual columns by going:
DataReader("ColumnName") OR DataReader(ColumnIndex)
I could create a "dataset" which entails building all the required
structures (columns, rows, and tables) and then I still have to load
and loop thru it....
Or just the datatable.
Is there some easier method to simply loop thru a block of data and
return the value of a column name I specifiy ?
Take a closer look at DataReader and DataSets ;-)- Hide quoted text -

- Show quoted text -

Apr 21 '07 #8
PFC Sadr <pf******@hotmail.comwrote in news:1177113537.643695.29650
@o5g2000hsb.googlegroups.com:
yeah... except you _STILL_ can't have multiple active DataReaders on
the same connection... even though Microsoft tried to CON us all into
buying SQL 2005-- so that we could use 'Multiple Active Result Sets'
I believe datareaders use a firehose mode to read data, thus only one
reader per connection.
I call BULLSHIT on microsoft, fix ADO.net it sucks balls compared to
ADO Classic
ADO Classic was definately easier to use ... but I don't have any major
complaints with ADO.NET.
Apr 21 '07 #9
uh

a) you can't leave a connection open
b) you can't have multiple recordsets open on the same connection

I mean.. WHAT A PIECE OF CRAP
I'd rather use ADO, the DAO then ADO.net


On Apr 20, 8:31 pm, Spam Catcher <spamhoney...@rogers.comwrote:
PFC Sadr <pfc_s...@hotmail.comwrote in news:1177113537.643695.29650
@o5g2000hsb.googlegroups.com:
yeah... except you _STILL_ can't have multiple active DataReaders on
the same connection... even though Microsoft tried to CON us all into
buying SQL 2005-- so that we could use 'Multiple Active Result Sets'

I believe datareaders use a firehose mode to read data, thus only one
reader per connection.
I call BULLSHIT on microsoft, fix ADO.net it sucks balls compared to
ADO Classic

ADO Classic was definately easier to use ... but I don't have any major
complaints with ADO.NET.

May 7 '07 #10
PFC Sadr <pf******@hotmail.comwrote in news:1178577938.496366.103000
@o5g2000hsb.googlegroups.com:
a) you can't leave a connection open
Just don't call the connection.close?
b) you can't have multiple recordsets open on the same connection
You can definately have multiple datasets open on a connection.

I mean.. WHAT A PIECE OF CRAP
I'd rather use ADO, the DAO then ADO.net


On Apr 20, 8:31 pm, Spam Catcher <spamhoney...@rogers.comwrote:
>PFC Sadr <pfc_s...@hotmail.comwrote in news:1177113537.643695.29650
@o5g2000hsb.googlegroups.com:
yeah... except you _STILL_ can't have multiple active DataReaders
on
the same connection... even though Microsoft tried to CON us all
into
buying SQL 2005-- so that we could use 'Multiple Active Result
Sets'
>>
I believe datareaders use a firehose mode to read data, thus only one
reader per connection.
I call BULLSHIT on microsoft, fix ADO.net it sucks balls compared
to
ADO Classic

ADO Classic was definately easier to use ... but I don't have any
major
>complaints with ADO.NET.


May 8 '07 #11

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

Similar topics

5
by: shank | last post by:
Can anyone give me some general ideas on why an error like Object doesn't support this property or method: 'ZoneRS.MoveFirst' comes up on a page? MoveFirst is a command to move to the first...
4
by: Thomas Scheiderich | last post by:
Why would you use the Recordset object over the Execute method of getting data from your Sql database. For example, I have the following: Execute Method...
5
by: j.mandala | last post by:
Someone is trying to run my Access 2002 database under Access 2003. He has had a number of problems: 1) i used the MSComCt2.ocx for it's Date and Time picker. I can't find it under 2003. Do I...
2
by: Daniel Di Vita | last post by:
I have created an ASP.NET using page that allows the user to page through a result set. I need to expand on this. On that same page I have a field where the user can type in a search string. When...
1
by: swellfr | last post by:
Hi i need a structure to store some 2D points and to be able to interpolate. The pb is that i need to find very very quickly what are the the closest values around my point. Is the...
1
by: sphinney | last post by:
All, I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
0
ADezii
by: ADezii | last post by:
In last week's Tip, I showed you how to use the ISAMStats Method of the DBEngine (DAO) to return vital statistics concerning Query executions such as: Disk Reads and Writes, Cache Reads and Writes,...
7
by: mirandacascade | last post by:
The questions are toward the bottom of this post. Situation is this: 1) Access 97 2) Multi-user appplication 3) SQL Server 2000 4) Sporadically (i.e. less than 1% of the time) encounter the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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,...

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.