Results 1 to 4 of 4

Thread: Sql adjustment for user input

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    509

    Resolved Sql adjustment for user input

    I am trying to allow the user to pick what they want to show from a database.

    I use:


    VB Code:
    1. strsql = "Select '" & txtitems.Text & "' from Invoice;"

    txtitems.text will actually equal * (all).

    This brings up just on colomn in the ms flex grid field header expr1000 then it has many rows all with * in them.

    When i replace the txtitems.text with *, it shows everything just as it should.

    Is there a way that i can allow for the user to select the fields without giving me undesired effects????????
    Last edited by snipered; Nov 21st, 2004 at 06:13 PM.

  2. #2
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457
    You need to drop the parenthasis. Use this

    VB Code:
    1. strsql = "Select " & txtitems.Text & " from Invoice;"
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2003
    Posts
    509
    thank you very much for a quick answer and a right one.

  4. #4
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457
    Personally I think SQL syntax sucks. I am always getting it round my neck as well. From many mistakes comes wisdom - or so they say. If that were true I would be a religious icon
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

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