|
 |
asp_databases thread: updates via recordsets...
Message #1 by "Ranga" <ranga@g...> on Thu, 6 Apr 2000 11:58:22
|
|
I am going nuts with database access using recordsets.
I found that the 'RecordCount" property is correct only if you do a
"MoveFirst"
I can not get to insert or update a record using recordsets. I prefer
recordsets rather than unwieldy INSERT/UPDATE SQL statement
construction that you need to do if you use the command object.
appreciate help from kind souls out there...
Message #2 by "jon" <jecusick@s...> on Thu, 6 Apr 2000 18:10:8
|
|
I can think of two reasons for using the RecordCount property(of course
there are more reason than two)
If you need to loop thru each record in the recordset then try this
Do Until MyRecordset.EOF
....'Do Something
MyRecordset.MoveNext
Loop
Also if you need to count the records do this
Do Until MyRecordset.EOF
....intX=intX+1
MyRecordset.MoveNext
Loop
intX will be a count of all the records.
On 04/06/00, ""Ranga" wrote:
> I am going nuts with database access using recordsets.
I found that the 'RecordCount" property is correct only if you do a
"MoveFirst"
I can not get to insert or update a record using recordsets. I prefer
recordsets rather than unwieldy INSERT/UPDATE SQL statement
construction that you need to do if you use the command object.
appreciate help from kind souls out there...
Message #3 by David Sussman <davids@i...> on Fri, 7 Apr 2000 10:02:39 +0100
|
|
RecordCount will only return an accurate count for certain cursor types.
This is generally all cursor types except server-side forward-only and
server-side dynamic. The reason is that when using these two cursor
types the entire recordset isn't processed. The records are read into
your client-application (asp page) in batches, so there's no way ADO can
know how many records there are. It's the nature of the cursor type.
Using the INSERT/UPDATE method is often faster, because you are simply
handing the data over to the data provider to do the update.
Dave
"Ranga" wrote in message
news:<6553BCF3E25DD2118F0A00AA00AE6AAA21DED5@t...>...
> I am going nuts with database access using recordsets.
>
> I found that the 'RecordCount" property is correct only if you do a
> "MoveFirst"
>
> I can not get to insert or update a record using recordsets. I prefer
> recordsets rather than unwieldy INSERT/UPDATE SQL statement
> construction that you need to do if you use the command object.
>
> appreciate help from kind souls out there...
>
$subst('Email.Unsub')
|
|
 |