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.
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.
What MoveNext and MovePrevious buttons?
Are are you storing the results of the recordset anywhere?
If posting code please use code tags, see here.
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.
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.
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.)
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.
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.![]()
Please Login or Register to view this content.
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.
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.
After reading your answer I think you're right. I can update the table and get a backup of the table.
Thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks