ChrisQuick
Programmer
Private Sub DoFindOwner(strOwnerName As String)
Dim cnnAccess As New ADODB.Connection
Dim rsOwner As New ADODB.Recordset
Dim strSQLSelect As String
Dim rsArray() As Variant
Dim intRecs As Integer
strSQLSelect = "select akpar_,akpsad,tcnam1,tcnam2,akpar from rpmout where tcnam1 like '%" & strOwnerName & "%' or tcnam2 like '%" & strOwnerName & "%' order by tcnam1"
cnnAccess.open "mydsn"
'cnnAccess.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=""d:\mydir\rpmout.mdb"";"
On Error Resume Next
rsOwner.open strSQLSelect, cnnAccess
If Not rsOwner.EOF Then
rsArray = rsOwner.GetRows
intRecs = UBound(rsArray, 2)
MsgBox intRecs, vbInformation
Else
MsgBox "No records", vbInformation
End If
rsOwner.Close
Set rsOwner = Nothing
cnnAccess.Close
Set cnnAccess = Nothing
End Function
If I run the function and my strOwnerName is equal to 'smith' for example, I get all the records that have smith in either the tcnam1 or tcnam2 fields. If my strOwnerName is equal to 'e' i only get one record??
I can do the same query (with the 'e')in MS Access 2000(after changing the % to *) and get back over 40K records.
Any ideas? chrisquick@aol.com
Geographic Information System (GIS), ASP, some Oracle
Dim cnnAccess As New ADODB.Connection
Dim rsOwner As New ADODB.Recordset
Dim strSQLSelect As String
Dim rsArray() As Variant
Dim intRecs As Integer
strSQLSelect = "select akpar_,akpsad,tcnam1,tcnam2,akpar from rpmout where tcnam1 like '%" & strOwnerName & "%' or tcnam2 like '%" & strOwnerName & "%' order by tcnam1"
cnnAccess.open "mydsn"
'cnnAccess.open "PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=""d:\mydir\rpmout.mdb"";"
On Error Resume Next
rsOwner.open strSQLSelect, cnnAccess
If Not rsOwner.EOF Then
rsArray = rsOwner.GetRows
intRecs = UBound(rsArray, 2)
MsgBox intRecs, vbInformation
Else
MsgBox "No records", vbInformation
End If
rsOwner.Close
Set rsOwner = Nothing
cnnAccess.Close
Set cnnAccess = Nothing
End Function
If I run the function and my strOwnerName is equal to 'smith' for example, I get all the records that have smith in either the tcnam1 or tcnam2 fields. If my strOwnerName is equal to 'e' i only get one record??
I can do the same query (with the 'e')in MS Access 2000(after changing the % to *) and get back over 40K records.
Any ideas? chrisquick@aol.com
Geographic Information System (GIS), ASP, some Oracle