RecordCount

He has: 9 posts

Joined: Oct 2001

Why is it if I do :

'ASP 3.0
rs.move 0

it display's the first record and not an error message?
Does it set the first record as 0, and move the 2nd record to 1?

Thanks in advanced...

They have: 447 posts

Joined: Oct 1999

perhaps the index is zero based?

to seek the first record you can use MoveFirst

He has: 9 posts

Joined: Oct 2001

I can understand that, I don't however understand then why if you use recordcount or absoluteposition, is starts from 1?

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

My guess is it's so you don't have to correct for the zero position. Oversight?

Record count should be accurate, a count of how many records you have? Absolute position is also logical, it's ABSOLUTELY in the first position, not the zeroth position.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

ADO is a bit strange with EOF and BOF (you'll find the same happens with EOF).

The AbsolutePosition for BOF is -1, whilst the first record is stored in AbsolutePosition 1 (BOF does not have a record associated with it).

Also...AbsolutePosition is indexed from 1, therefore 0 doesn't really do anything. ADO probably returns the first record becasue it is the nearest match.

a Padded Cell our articles site!

He has: 9 posts

Joined: Oct 2001

Thanks, this helps...

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

Does this suprise anyone that microsoft has it's own theory on referencing lists? I mean, what were they thinking?!?

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

Hehehe, yeah. I've been programming VB for years, the more I know about it - the less I like it. It's so tempramental, they try to make programming "easy" but just make everything over-complicated and illogical...For web based stuff PHP is the way to go: no COM overhead for a start.

a Padded Cell our articles site!

druagord's picture

He has: 335 posts

Joined: May 2003

Quote: I mean, what were they thinking?!?

they where thinking of the best way to make money doing over complicated things to sell you programming course. then every 3 or 4 years they change everything so you start from 0 again

IF , ELSE , WHILE isn't that what life is all about

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

or 1, depending.

druagord's picture

He has: 335 posts

Joined: May 2003

Smiling thanks suzanne i should have seen that one

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.