F
Frank Dulk
The problem is the following:
1) I am making a consultation, 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?
2) in the last line in bold, when being executed (Set dgLocalizar.DataSource
= dat_nf.Recordset (ChildCMD ") .UnderlyingValue) does it happen a mistake
(3265 - cannot THE item be found in the collection corresponding to the name
or to the ordinal requested)... THE ONE what make?
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
''** Se possui dados, carrega o grid...
If Not dat_nf.Recordset.EOF Then Set dgLocalizar.DataSource =
dat_nf.Recordset("ChildCMD").UnderlyingValue
Obs: Use VB6(ADO) with Access97 with link of tables oracle.
1) I am making a consultation, 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?
2) in the last line in bold, when being executed (Set dgLocalizar.DataSource
= dat_nf.Recordset (ChildCMD ") .UnderlyingValue) does it happen a mistake
(3265 - cannot THE item be found in the collection corresponding to the name
or to the ordinal requested)... THE ONE what make?
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
''** Se possui dados, carrega o grid...
If Not dat_nf.Recordset.EOF Then Set dgLocalizar.DataSource =
dat_nf.Recordset("ChildCMD").UnderlyingValue
Obs: Use VB6(ADO) with Access97 with link of tables oracle.