Results 1 to 2 of 2

Thread: Select from combo box(RESOLVED)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2002
    Location
    Newcastle
    Posts
    19

    Select from combo box(RESOLVED)

    The combo1.text box contains table names but some times there is a space in the name and the select query will not work i have tried with and without brackets any ideas thanx


    VB Code
    ________________________________________________
    rs.Open " SELECT * " & _
    " FROM " & (Combo1.Text), _
    cnn, _
    adOpenKeyset, _
    adLockReadOnly, _
    adCmdText
    rs.MoveFirst
    ____________________________________________________End Code
    Last edited by david maddison; Apr 8th, 2003 at 01:46 AM.
    david

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313
    Depends on your database, but try square brackets, or single quotes:
    VB Code:
    1. rs.Open " SELECT * " & _
    2. " FROM [b][[/b]" & Combo1.Text & [b]"]"[/b], _
    3. cnn, _
    4. adOpenKeyset, _
    5. adLockReadOnly, _
    6. adCmdText
    7. rs.MoveFirst

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