Error code ( LIKE )

F

Frank Dulk

problem is the following:

I am making a query, where it should be informed the code or a description.
But when I not use the clause LIKE back anything in the result and if I
consult for the code back. What can be happening? Does have other command
that I can substitute LIKE?

If PesquisaCadastro = "Frequencia" Then
Sql = "Select DISTINCT 0 as Cnpj, nomefornecedor AS Descricao,
codigofornecedor AS Legado " _
& "From Cad_Frequencia as F "
If OptCodigo Then
Sql = Sql & " WHERE F.codigofornecedor = '" & Trim(TxtPesquisa)
& "'" _
& " Order By codigofornecedor"
Else
Sql = Sql & " WHERE F.nomefornecedor LIKE '" & Trim(TxtPesquisa)
& "*'" _
& " Order By nomefornecedor"
End If
End If
Sql = "SHAPE {" & Sql & "} as ChildCMD"
''
dat_nf.ConnectionString = "Provider=MSDataShape.1;Persist Security
Info=False;Data Source=J:\Controle_qualidade\cq_pb_or.mdb;User ID=Admin;Data
Provider=Microsoft.Jet.OLEDB.3.51
dat_nf.RecordSource = Sql
dat_nf.CursorType = adOpenDynamic
dat_nf.Refresh
'' * * It is possessed data, it carries the grid...
If Not dat_nf.Recordset.EOF Then Set dgLocalizar.DataSource =
dat_nf.Recordset("ChildCMD").UnderlyingValue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top