在進行數據庫的查詢時
例如想在一個用戶數據庫中查詢他的用戶名和他的密碼
例如他的名字是
這時當你執行以下的查詢語句時
SQL =
SQL = SQL &
因為你的SQL將會是這樣
SELECT * FROM SecurityLevel WHERE UID=
在SQL中
Function ReplaceStr (TextIn
ByVal Replacement As String
ByVal CompMode As Integer)
Dim WorkText As String
If IsNull(TextIn) Then
ReplaceStr = Null
Else
WorkText = TextIn
Pointer = InStr(
Do While Pointer >
WorkText = Left(WorkText
Mid(WorkText
Pointer = InStr(Pointer + Len(Replacement)
Loop
ReplaceStr = WorkText
End If
End Function
Function SQLFixup(TextIn)
SQLFixup = ReplaceStr(TextIn
End Function
Function JetSQLFixup(TextIn)
Dim Temp
Temp = ReplaceStr(TextIn
JetSQLFixup = ReplaceStr(Temp
End Function
Function FindFirstFixup(TextIn)
Dim Temp
Temp = ReplaceStr(TextIn
FindFirstFixup = ReplaceStr(Temp
End Function
有了上面幾個函數後
SQL =
SQL = SQL &
From:http://tw.wingwit.com/Article/Fault/201311/10498.html