G
George Hester
This doesn't work in a DAO.Recordset. What's the trouble? It does work in a ADOR.Recordset but not in a DAO.Recordset.
strSQLHyphens = "SELECT [" & newTableName & "].[" & strFldName2 & "] " & _
"FROM [" & newTableName & "] " & _
"WHERE ([" & newTableName & "].[" & strFldName2 & "] " & _
"LIKE '%-%');"
fails with
Set RsQry = dB.OpenRecordset(strSQLHyphens)
'RsQry.MoveLast
MsgBox RsQry.RecordCount
Set RsQry = Nothing
But this:
strSQLHyphens = "SELECT [" & newTableName & "].[" & strFldName2 & "] " & _
"FROM [" & newTableName & "] " & _
"WHERE ([" & newTableName & "].[" & strFldName2 & "]='www.microsoft.com'";"
works just fine. It is not an issue of defining variables or whether they exist. That is not the problem. It seems the LIKE predicate is not supported here. This is a local database. Is that right?
strSQLHyphens = "SELECT [" & newTableName & "].[" & strFldName2 & "] " & _
"FROM [" & newTableName & "] " & _
"WHERE ([" & newTableName & "].[" & strFldName2 & "] " & _
"LIKE '%-%');"
fails with
Set RsQry = dB.OpenRecordset(strSQLHyphens)
'RsQry.MoveLast
MsgBox RsQry.RecordCount
Set RsQry = Nothing
But this:
strSQLHyphens = "SELECT [" & newTableName & "].[" & strFldName2 & "] " & _
"FROM [" & newTableName & "] " & _
"WHERE ([" & newTableName & "].[" & strFldName2 & "]='www.microsoft.com'";"
works just fine. It is not an issue of defining variables or whether they exist. That is not the problem. It seems the LIKE predicate is not supported here. This is a local database. Is that right?