ITeye博客

字符串截示例

liseor · 2011-01-28 13:36 · access · 数据库 · C · C++ · Access · Web · QQ · Markdown

ACCESS 打开网页


Private Sub cmdAccess_Click()
    Dim webAddreess As String
    Dim Web
    Set Web = CreateObject("InternetExplorer.Application")
    Web.Visible = True
    WebAddress = "http://www.accessoft.com"
    Web.Navigate WebAddress

End Sub

ACCESS 执行子窗体SQL


Private Sub cmdClear_Click()
    Me.frmChild.SourceObject = ""
    '去掉系统警告
    DoCmd.SetWarnings False
    '清空截取的字符值
    DoCmd.RunSQL "UPDATE tblSizelist SET tblSizelist.size1 = Null, tblSizelist.size2 = Null, tblSizelist.size3 = Null;"
    '重新加载子窗体
    Me.frmChild.SourceObject = "frmSizelist"
End Sub


ACCESS 关闭子窗体


Private Sub cmdClose_Click()
    DoCmd.Close
End Sub

ACCESS 打开QQ 对话窗口


Private Sub cmdQQ_Click()
    Dim webAddreess As String
    Dim Web
    Set Web = CreateObject("InternetExplorer.Application")
    Web.Visible = True
    WebAddress = "http://wpa.qq.com/msgrd?V=1&Uin=56217686&Site=UMVsoft&Menu=yes"
    '打开QQ 对话窗口
    Web.Navigate WebAddress

End Sub

Private Sub Form_Load()
'给窗体写上标题
    Me.Caption = "实现字符串提取功能的示例"

End Sub

ACCESS 截取字符



Private Sub cmdOK_Click()
    Dim RST As DAO.Recordset
    Dim strSize As String
    Dim strSizeB As String
    Dim x As Integer
    Dim y As Integer
    Me.frmChild.SourceObject = ""
    Set RST = CurrentDb.OpenRecordset("tblSizelist", dbOpenDynaset)
    RST.MoveFirst
    Do Until RST.EOF
        RST.Edit
        strSize = RST!OrderSize
        '获得第一个*号出现的位置
        x = InStr(strSize, "*")
        strSizeB = Mid(strSize, x + 1)
        '获得第二个*出现的位置
        y = InStr(strSizeB, "*") + x
        RST!size1 = Left(strSize, x - 1)
        RST!size2 = Mid(strSize, x + 1, y - x - 1)
        RST!size3 = Mid(strSize, y + 1)
        RST.Update
        RST.MoveNext
    Loop
    RST.Close
    Set RST = Nothing

    '重新加载子窗体
    Me.frmChild.SourceObject = "frmSizelist"

End Sub

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。