Results 1 to 5 of 5

Thread: Forward and Back buttons for SQL Queries

  1. #1

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    Arrow 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,

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    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?

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950

    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.
    Tengo mas preguntas que contestas

  4. #4

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    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,

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    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.

Posting Permissions

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



Click Here to Expand Forum to Full Width