Visual Basic 6.0 problem find record in datagrid with partial key/string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LordOne
    New Member
    • Mar 2010
    • 3

    Visual Basic 6.0 problem find record in datagrid with partial key/string

    As the title says I have a adodc with one table "sql" who has three fields, and I want to filter the datagrid by a string as the user type letter by letter.
    I've wrote this code :

    Private Sub Text1_Change()
    If Adodc1.Recordse t.RecordCount > 0 Then Adodc1.Recordse t.MoveFirst
    Adodc1.RecordSo urce = "details where upper(Den_Furni zor) like '%" & UCase(Trim(Text 1.Text)) & "%'"
    Adodc1.Refresh

    End Sub

    and I don't now why I have an error
    "INVALID SQL statement; expected 'DELETE', 'INSERT' , 'PROCEDURE' , 'SELECT' or 'UPDATE' "
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    Because you do not have a fully qualified select, update, insert, delete, procdeure statement...

    try...
    Code:
    = "SELECT * FROM details where 'the rest of your sql statement...


    Good Luck

    Comment

    • LordOne
      New Member
      • Mar 2010
      • 3

      #3
      Thank you for your quick reply, but I did like you said and now I have this this error "Run-time error 424' :
      Object requierd



      Private Sub Text1_Change()
      If Adodc1.Recordse t.RecordCount > 0 Then Adodc1.Recordse t.MoveFirst
      Adodc1.RecordSo urce = "SELECT * From tabel1 where upper(Den_Furni zor) like '%" & UCase(Trim(Text 1.Text)) & "%'"
      Adodc1.Refresh
      End Sub


      Can you please help me ? I'm newbie .. sorry if I didn't understand you

      Comment

      • LordOne
        New Member
        • Mar 2010
        • 3

        #4
        UPDATE : now I have the error Undefined function 'upper' in expresion

        Comment

        Working...