|
本帖最后由 Henry D. Sy 于 2009-4-18 21:01 编辑
- Public Function gStr(ByVal strTblName As String, _
- ByVal strFldName As String, _
- OldStr As String) As String
- Dim rs As New ADODB.Recordset
- Dim i As Integer
- Dim tempStr As String
- Dim strSQL As String
- strSQL = "select * from " & strTblName & " where " & strFldName _
- & "='" & OldStr & "'"
- With rs
- .Open strSQL, CurrentProject.Connection, adOpenKeyset, adLockReadOnly
- For i = 1 To Len(.Fields(strFldName))
- tempStr = Mid(.Fields(strFldName), i, 1)
- If IsNumeric(tempStr) Then
- gStr = Left(.Fields(strFldName), i - 1)
- Exit For
- End If
- Next
- .Close
- End With
- Set rs = Nothing
- End Function
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|