MovePrevious

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

MovePrevious

Post by pgriffin » Wed Aug 23, 2006 7:00 pm

I've gone stupid (yet again)....

shouldn't MovePrevious be as simple as this?

Sub MovePrevRec
RecordSet.MovePrevious
End Sub

vbr>MovePrevRec

As long as I have created "RecordSet", which I am CERTAIN I have, why would MacroScheduler tell me this is "not allowed in this context" or various other errors.....

I am successfully using MoveFirst, MoveNext but can't seem to use MovePrevious....

I'm working on it, but will take any input....

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed Aug 23, 2006 8:02 pm

I believe the default cursor type in an ADO query is a forward only cursor. You may have to change the way you open the ADO connection.

Found this - it may help:
http://tutorials.aspfaq.com/8000xxxxx-e ... rrors.html
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

hvdberg
Junior Coder
Posts: 39
Joined: Wed Jul 12, 2006 1:50 pm
Location: Netherlands

Post by hvdberg » Wed Aug 23, 2006 8:09 pm

Actually, it's not Macro Scheduler that is telling you this, it's ADO or DAO that is telling you this. Depending on the type of recordset that is created, MovePrevious may or may not be available.

There are 4 types of recordsets: Table, DynaSet, Snapshot, Forward-only

Check out http://msdn.microsoft.com/library/defau ... ma0501.asp for a more elaborate discussion on this. It (among other things) states that a forward only type recordset is
the default when you create a recordset in an ODBC workspace
HTH,
Henk

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Aug 23, 2006 8:40 pm

Thanks for the input, guys. I finally went with a "conditional" MoveNext. I believe you are each correct that the cursor is ForwardOnly.

lesson learned, problem solved....

next problem, please... :)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts