Code:
Option Compare Database
Option Explicit
Public Function SafeSQL(strArg As String) As String
SafeSQL = Replace(strArg, "'", "''")
End Function
In the code to create the SQL string you might use something like :
Code:
If DCount(Expr:="*", _
Domain:="[tblSecurity]", _
Criteria:="[UserName]='" & SafeSQL(Me.User) & "' AND " & _
"[Password]='" & SafeSQL(Me.Password) & "'") > 0 Then
...
Leave a comment: