⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 备份.bas

📁 本需求规格说明书是为了开发《飞机订票系统》而编写的
💻 BAS
字号:
Attribute VB_Name = "备份"
'
'        If getDB Then                                  '如果 weboy 数据库存在,则...
'            If getUsersTable And getConsumersTable Then '如果 users 表及 consumer 表存在,则...
'               'MsgBox "数据库已存在"
'                'MsgBox "users 表已经存在"
'                Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
'                con.Open
'                Call saveReg
'                Call userLand
'                con.Close
'            ElseIf getUsersTable = False And getConsumersTable = True Then  '当数据库已找到,而表没找到时
'                MsgBox "数据库已存在,users 表未找到,CConsumers 表已存在"
'                If MsgBox("管理员表未找到,单击 OK 按钮创建", vbOKCancel, "系统错误") = vbOK Then
'                    Call createUTable
'                    MsgBox "用户表已创建完成"
'                End If
'            ElseIf getUsersTable = True And getConsumersTable = False Then
'                MsgBox "数据库已存在,users 表已存在,CConsumers 表未找到"
'                If MsgBox("用户表未找到,单击 OK 按钮创建", vbOKCancel, "系统错误") = vbOK Then
'                    Call createCTable
'                    MsgBox "表已创建完成"
'                End If
'            ElseIf getUsersTable = False And getConsumersTable = False Then
'                MsgBox "数据库已存在,users 表未找到,CConsumers 表未找到"
'                If MsgBox("管理员表及用户表未找到,单击 OK 按钮创建", vbOKCancel, "系统错误") = vbOK Then
'                    Call createCTable
'                    Call createUTable
'                    MsgBox "表已创建完成"
'                End If
'            End If
'        Else                                           '当数据库未到找时''''''
'
'        End If
'    End If
    '''''''''''''''''''''''''''''''''''''''''''''

'判断能否在 weboy 数据库中找到 users 表
'Public Function getUsersTable() As Boolean
'
'    Set con = New Connection
'    Set rst = New Recordset
'
'    getUsersTable = False
'    Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
'    con.Open
'
'    rst.Open "select name from sysobjects where type='u'", con, adOpenDynamic, adLockOptimistic
'    rst.MoveFirst
'
'    Do While Not rst.EOF
'        If rst!name = "users" Then
'            getUsersTable = True
'            Exit Do
'        End If
'        rst.MoveNext
'    Loop
'
'    rst.Close
'    con.Close
'End Function

'判断是能否在 weboy 数据库中找到 consumer 表
'Public Function getConsumersTable()
'
'    Set con = New Connection
'    Set rst = New Recordset
'
'    getConsumersTable = False
'    Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
'    con.Open
'
'    rst.Open "select name from sysobjects where type='u'", con, adOpenDynamic, adLockOptimistic
'    rst.MoveFirst
'
'    Do While Not rst.EOF
'        If rst!name = "CConsumers" Then
'            getConsumersTable = True
'            Exit Do
'        End If
'        rst.MoveNext
'    Loop
'
'    rst.Close
'    con.Close
'End Function
    'password = InputBox("请输入密码!")
    'If password = "" Then
    '    MsgBox "密码不能为空", vbExclamation, "取款不成功"
    '    Exit Sub
    'Else
    '    rst.Open "select * from CConsumers where id='" & txt(0).Text & "'", con, adOpenDynamic, adLockOptimistic
    '    If password = rst!password Then
    '        rst.Close
    '        con.Execute "insert " & txt(0).Text & " values('" & nowDate & "','get','" & money & "','" & balance - money & "','" & userName & "')"
    '        con.Close
    '        MsgBox "取款成功"
    '        Exit Sub
    '        Unload Me
    '    Else
    '        rst.Close
    '        MsgBox "密码不正确!"
    '        Exit Sub
    '    End If
    'End If
        'rst.Open "select spid from sysprocesses where dbid=db_id('hy')", con
        'Do While Not rst.EOF
        '    Cn.Execute "kill " & rst("spid") '杀掉sql服务器的所有连接,否则会出现:数据库正在使用,无法完成排它操作等等,很重要
        '    rst.MoveNext
        'Loop
        'rst.Close
'    On Error Resume Next
'    Dim rst As New Recordset
'    Call LinkDB(landWay, SName, "weboy", SUName, SUPw)
'    con.Open
'    rst.Open "select * from accrual", con, adOpenDynamic, adLockOptimistic
'    rst.MoveFirst
'    Do While Not rst.EOF
'        If rst!theYear = "0" Then
'            txtFA(0).Text = rst!percentage
'        ElseIf rst!theYear = "1" Then
'            txtFA(1).Text = rst!percentage
'        ElseIf rst!theYear = "2" Then
'            txtFA(2).Text = rst!percentage
'        ElseIf rst!theYear = "3" Then
'            txtFA(3).Text = rst!percentage
'        ElseIf rst!theYear = "5" Then
'              txtFA(5).Text = rst!percentage
'        ElseIf rst!theYear = "8" Then
'              txtFA(8).Text = rst!percentage
'         End If
'         rst.MoveNext
'    Loop
'    rst.Close
'    con.Close

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -