|
こもれび です
「その4」 のソースコードは次のものと差し替えてください
(少し高速化しました)
Public Function KinsokuDet(KensaStr) As Boolean
Dim i As Integer
Dim j As Integer
Dim h1 As String
Dim KensaData As String
Dim SQL01 As String
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = CurrentProject.Connection
SQL01 = "SELECT * FROM T_KINSOKU;"
rs.Open SQL01, cn, adOpenKeyset, adLockReadOnly
KinsokuDet = False
KensaData = KensaStr
KensaData = Trim(KensaData)
i = Len(KensaData)
j = 1
Do Until j > i Or KinsokuDet = True
h1 = Mid(KensaData, j, 1)
rs.MoveFirst
Do Until rs.EOF
If h1 = rs!Data Then
KinsokuDet = True
Exit Do
End If
rs.MoveNext
Loop
j = j + 1
Loop
rs.Close: Set rs = Nothing
cn.Close: Set cn = Nothing
End Function
|
|