Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 149,470 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,965 people online right now. Registration is fast and FREE... Join Now!




Problem with rs.MovePrevious

 
Reply to this topicStart new topic

Problem with rs.MovePrevious

scalt
21 Jan, 2008 - 05:33 PM
Post #1

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 111



Thanked: 2 times
Dream Kudos: 25
My Contributions
Hi

I am using an ADO connection (JET 4.0) to connect to an Excel spreadsheet, and the rs.MovePrevious command is gigving me an error simply saying that this action isn't supported by this database. Is there an instruction I have to include in the opening header to enable this or what?

CODE

BaseConn.Open("Provider=Microsoft.Jet.OLEDB.4.0;" & _
                        "Data Source=" & FileName(0) & ";" & _
                        "Extended Properties=""Excel 8.0;HDR=NO;IMEX=1" & """")


rs.MoveNext works fine.

Thanks for any help or ideas

This post has been edited by scalt: 21 Jan, 2008 - 07:23 PM
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Problem With Rs.MovePrevious
21 Jan, 2008 - 06:00 PM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
How are you opening the recordset? Are you using Execute by chance? If so, you are opening the recordset using a Forward only cursor by default. Forward only cursors will not let you go backwards.

Check that out and if you still have problems, show us how you open the recordset.

Thanks. smile.gif
User is offlineProfile CardPM
+Quote Post

scalt
RE: Problem With Rs.MovePrevious
21 Jan, 2008 - 07:23 PM
Post #3

D.I.C Head
Group Icon

Joined: 22 Nov, 2007
Posts: 111



Thanked: 2 times
Dream Kudos: 25
My Contributions
Sorry, I forgot to add that in.

CODE


conString = "(SELECT F3, F" + col + " FROM [Paddock$] WHERE (F3 BETWEEN " + CStr(startMonth) + " AND " + CStr(endMonth) + "))"

BaseRS.Open(conString, BaseConn)




User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 02:27PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month