我在运行一个程序时,系统提示"编译错误:找不到工程或库",程序运行到下面这个地方就停止了:
Public Function MakeStr(ByVal Str As String) As String
MakeStr = Trim(Replace(Str, "'", "''"))
End Function
我不知是什么原因,恳请各位高手指点指点!不胜感激!!!
我的GeneralFunc模块的代码如下:
[/CODE]
Public Function In_Single(KeyAscii As Integer) As Boolean
Dim Ch_Accept_Single(20) As String
'可以接受的字符数组
Ch_Accept_Single(0) = "0"
Ch_Accept_Single(1) = "1"
Ch_Accept_Single(2) = "2"
Ch_Accept_Single(3) = "3"
Ch_Accept_Single(4) = "4"
Ch_Accept_Single(5) = "5"
Ch_Accept_Single(6) = "6"
Ch_Accept_Single(7) = "7"
Ch_Accept_Single(8) = "8"
Ch_Accept_Single(9) = "9"
Ch_Accept_Single(10) = "."
Ch_Accept_Single(11) = "-"
Ch_Accept_Single(12) = Chr(8)
'检查输入字符是否在数组中
In_Single = False
For i = 0 To 12
If Chr(KeyAscii) = Ch_Accept_Single(i) Then
In_Single = True
End If
Next
End Function
Public Function In_Int(KeyAscii As Integer) As Boolean
Dim Ch_Accept_Int(20) As String
'可以接受的字符数组
Ch_Accept_Int(0) = "0"
Ch_Accept_Int(1) = "1"
Ch_Accept_Int(2) = "2"
Ch_Accept_Int(3) = "3"
Ch_Accept_Int(4) = "4"
Ch_Accept_Int(5) = "5"
Ch_Accept_Int(6) = "6"
Ch_Accept_Int(7) = "7"
Ch_Accept_Int(8) = "8"
Ch_Accept_Int(9) = "9"
Ch_Accept_Int(10) = "-"
Ch_Accept_Int(11) = Chr(8)
'检查输入字符是否在数组中
In_Int = False
For i = 0 To 11
If Chr(KeyAscii) = Ch_Accept_Int(i) Then
In_Int = True
End If
Next
End Function
Public Function InCombo(ByVal Str As String, _
ByVal Combo1 As ComboBox) As Boolean
i = 0
Do While i < Combo1.ListCount
If Combo1.List(i) = Trim(Str) Then
InCombo = True
Exit Function
End If
i = i + 1
Loop
MsgBox Str + " 不在列表中,请重新设置"
InCombo = False
End Function
Public Function Lench(ByVal TmpStr As String) As String
Lench = LenB(StrConv(TmpStr, vbFromUnicode))
End Function
Public Function TrimStr(ByVal Str As String) As String
If InStr(Str, Chr(0)) <= 0 Then
TrimStr = Trim(Str)
Else
TrimStr = Trim(Left(Str, InStr(Str, Chr(0)) - 1))
End If
End Function
Public Function MakeStr(ByVal Str As String) As String
MakeStr = Trim(Replace(Str, "'", "''"))
End Function
Public Sub EnterTAB(KeyAscii As Integer)
If KeyAscii = 13 Then '13表示回车键
SendKeys "{TAB}" '转换为TAB键
End If
End Sub
其中加粗的地方为运行停止的地方