Hi all,

I am creating very simple database in excel and I would like to implement simple searching mechanism using ADO.

To achieve this aim I wrote such a piece of code:

VB Code:
  1. Dim search_result As String
  2.  
  3. search_result = "'%" & frmsearch.TextBox1.Text & "%'"
  4.  
  5. Dim rec As ADODB.Recordset
  6. Dim conn As ADODB.Connection
  7.  
  8. Set conn = New ADODB.Connection
  9.  
  10. conn.Provider = "Microsoft ole db provider for odbc drivers"
  11. conn.ConnectionString = "driver={microsoft excel driver (*.xls)};dbq=" & _
  12. ThisWorkbook.Path & "\film_catalog.xls;"
  13.  
  14. conn.Open
  15.  
  16. Set rec = New ADODB.Recordset
  17. rec.CursorLocation = adUseClient
  18. rec.Open "select * from [catalog$] where category like " & (search_result), conn, adOpenDynamic, adLockOptimistic

but I have such a problem: excel doesn't ignore size of chars.
for exmaple: when I want to search a film category horror so I type horror but in database I have Horror so that I get empty recordset.

I was trying to use Option Compare Text but it doesn't work,

How can I make excel ignoring char's size???

please help

thx in advance for your help

regards,
sweet_dreams