+ Reply to Thread
Results 1 to 9 of 9

How to implement MoveNext - Mysql

  1. #1
    Registered User
    Join Date
    10-18-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    30

    How to implement MoveNext - Mysql

    Hi
    I have a connection to mysql database. How can I implement the button moveNext and MovePrevious?
    Here is my code
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to implement MoveNext - Mysql

    What MoveNext and MovePrevious buttons?

    Are are you storing the results of the recordset anywhere?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    10-18-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How to implement MoveNext - Mysql

    I'm not storing the recordset anywhere. My code is on the form.Ativate
    I need the buttons MoveNext and Previous because I need to update the recordeset and I need to move between all my records with movenext and previous buttons.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to implement MoveNext - Mysql

    Why aren't you storing the data anywhere?

    If you don't store it anywhere then you'll need to connect to the database and run a query every time you want to move to another record.

    As it is your code is returning all records from the table clientes, it's not returning a specific record.

  5. #5
    Registered User
    Join Date
    10-18-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How to implement MoveNext - Mysql

    Hum I understand
    How can I store the data? ( I thought maybe it was some kind of function who gives me the position in my recordset and I save this position on a variable. When I click to movenext button I have to increment only the position where I am.)

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to implement MoveNext - Mysql

    The easiest way to store the data would be to put it on a worksheet.

    You can do that quite easily, this is all you need.
    Please Login or Register  to view this content.
    Or if you want to add the field names as headers.

    Please Login or Register  to view this content.
    Once you have the data on a worksheet it should be easy to load records and then move through or search them.

  7. #7
    Registered User
    Join Date
    10-18-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How to implement MoveNext - Mysql

    Thank you Norie but it seems no to be the solution I need.
    I need to update a remote Mysql Database with 1000 records and is not possible to download all the records of my table and after the modifications update it again to Mysql Database. I have one way to do that with the my id field. I have to store the id where I'm and with the select, increment it. The problem is if the record was deleted. In this case the id not exists and got error.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: How to implement MoveNext - Mysql

    Not sure I follow.

    Why can't you download all the records?

    Also, how would my suggestion prevent you updating records?

    The record could be shown on the form, then the user can make the necessary alterations.

    Once finished the user clicks a button that executes an UPDATE statement to update the table.

    The alterations could also be written back to the worksheet to keep the worksheet in sync with the database.

    PS All this would be far easier in Access where you could set up a link to the table and treat it just like a local table.

  9. #9
    Registered User
    Join Date
    10-18-2012
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: How to implement MoveNext - Mysql

    After reading your answer I think you're right. I can update the table and get a backup of the table.

    Thank you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1