S
Sean
Hello all,
I'm having a hell of a time trying to get the like
operator to work when creating a recordset.
I have a table noi-name-phone that has a record where the
field username is testuser. The following doesn't return
any records. If I change the testu* to testuser I get the
record. Can someone tell me what I am doing wrong?
Thanks.
Sean
Dim objconn As ADODB.Connection
Dim ssql As String
Dim qte As String
Dim recr As New ADODB.Recordset
Set objconn = CurrentProject.Connection
qte = "'"
ssql = "select username from [noi-name-phone] where
username like " & qte & "testu*" & qte
recr.Open ssql, objconn, adOpenKeyset, adLockReadOnly
Debug.Print recr.RecordCount
I'm having a hell of a time trying to get the like
operator to work when creating a recordset.
I have a table noi-name-phone that has a record where the
field username is testuser. The following doesn't return
any records. If I change the testu* to testuser I get the
record. Can someone tell me what I am doing wrong?
Thanks.
Sean
Dim objconn As ADODB.Connection
Dim ssql As String
Dim qte As String
Dim recr As New ADODB.Recordset
Set objconn = CurrentProject.Connection
qte = "'"
ssql = "select username from [noi-name-phone] where
username like " & qte & "testu*" & qte
recr.Open ssql, objconn, adOpenKeyset, adLockReadOnly
Debug.Print recr.RecordCount