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:
Dim search_result As String search_result = "'%" & frmsearch.TextBox1.Text & "%'" Dim rec As ADODB.Recordset Dim conn As ADODB.Connection Set conn = New ADODB.Connection conn.Provider = "Microsoft ole db provider for odbc drivers" conn.ConnectionString = "driver={microsoft excel driver (*.xls)};dbq=" & _ ThisWorkbook.Path & "\film_catalog.xls;" conn.Open Set rec = New ADODB.Recordset rec.CursorLocation = adUseClient 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




Reply With Quote