i am new to the LIKE operator. i am setting up a search in an access database so the user can search a partial string, eg search for "White" and find all records with the word white as part of the field contents.
this works when i make a query inside access but i cannot duplicate it in VB6 when connected to the same database table. i get an empty recordset
what am i doing wrong?
Code:Private Sub Form_Load() Set CNSKUList = New ADODB.Connection CNSKUList.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & WorkFlowDatabasePath & ";" & "user id=admin;password=;" CNSKUList.Open Set RstSKUList = New ADODB.Recordset end sub Private Sub SearchButton_Click() RstSKUList.Open "select * from SKULIST WHERE Description LIKE ' * White * ' ", CNbatchtable, adOpenKeyset, adLockOptimistic, adCmdTableDirect Set SKUListMSHFlexGrid.DataSource = RstSKUList RstSKUList.Close end sub




Reply With Quote