Results 1 to 3 of 3

Thread: Mysql Search

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Question Mysql Search

    iam making a dictionary program and it need a search function iam using this query
    SELECT * FROM tbltel WHERE Fname='search'
    but this need exact phrase but want seach for any word from database.
    i also try this but it is also not working
    SELECT * FROM tbltel WHERE Fname like 'search'


    PHP Code:
           Try
                
    Dim dbConn As OleDbConnection
                Dim dbCommand 
    As New OleDbCommand()
                
    Dim strPath As String

                strPath 
    patH
                dbConn 
    = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
                                        
    "DATA SOURCE=" _
                                        
    strPath)
      
    dbCommand.CommandText "SELECT * FROM tbltel WHERE Fname like " _
                                      
    "'" ListBox1.Text "'"
                
    dbCommand.Connection dbConn
                dbConn
    .Open()
                
    Dim dbDR As OleDb.OleDbDataReader dbCommand.ExecuteReader

                
    While dbDR.Read
                    rtword
    .Text dbDR("Name".ToString)
                    
    rtresult.Text dbDR("data".ToString)
                    
    ToolStripStatusLabel2.Text dbDR("ID".ToString)
                
    End While

                
    dbConn.Close()



            Catch 
    err As System.Exception
                MsgBox
    (err.Message)
            
    End Try 

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mysql Search

    You might want to try a little search first.

    http://www.google.com.au/search?q=SQ...ient=firefox-a
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2009
    Posts
    99

    Re: Mysql Search

    ok thanks i found it

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