Forward and Back buttons for SQL Queries
Hi everyone,
I currently have a program in place that allows the users to conduct sql statements on a MySQL database. I would like to institute a forward and back button into my program. I am just unsure how to start a list of what sql statements the user ran since the last login. Does anyone have an idea on how to create a tempory list such as this? I don't think this would be hard to implement once I have created this list. The users are only running select statements not updates so I wouldn't have to worrry about rolling back any updates.
Thanks,
Re: Forward and Back buttons for SQL Queries
We "push" all our WHERE clause values into a tree-view - which can be displayed by clicking on a HISTORY button.
We try to "push" the new entries into the TREE on existing branches - and always keep the last one used "selected".
What kind of values are used in your WHERE clauses?
Re: Forward and Back buttons for SQL Queries
How temporary are the SQL statements? If just in one session, you could store them in an array. If more than one session, stored in a table, for instance you could run into various problems.
One option would be to allow users to save commonly run queries, and let them select them from a list. If they need to set various parameters, you could prompt for them in various ways. Or if there are commonly used sets of parameters, something like szlamany's select would work.
But for a Forward/Back button, an array may be best. I suppose a collection would work, but might be overkill.
Re: Forward and Back buttons for SQL Queries
Since I only want to keep the information from one session it looks like an array would work best. I have never worked with arrays before though so if someone could show me what it would look like in code to store and retrieve the information I would really appreciate it.
thanks,
Re: Forward and Back buttons for SQL Queries
There is an article in our Classic VB FAQ's (link in my signature) which explains how to use arrays.