Results 1 to 2 of 2

Thread: Executing an SQL command

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    2
    I have an SQL command object in my data environment. The SQL command receives a variable from the user window to extract the required information from the recordset.

    How do I call the SQL command, retrieve the user-entered variable, execute it and display the result of the query in my user window in a data grid?

    I am utilizing ADO.

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Posts
    88
    first you need to define a variable to hold the data or paramter that the user will input. we'll call it 'strVariable'. next, insert it into a sql statement along with the name of the table that contains the data. the name of the table will be 'Table'.

    "SELECT * FROM Table WHERE '" & strVariable & "'"

    important: when i first started struggling with sql statements, i had a real problem with using single quotes and double quotes. make sure you get the syntax right or you will cause yourself a lot of grief. remember that parameter must be surrounded by single quotes.

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