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

📄 mdumain.bas

📁 图书管理子系统之一
💻 BAS
字号:
Attribute VB_Name = "mdutoyong"
Option Explicit
'公用子过程
Public myconn As ADODB.Connection        '定义各对象类型
Public myrecor As ADODB.Recordset
Public myCmd As ADODB.Command
Public mysql As String
Public Sub dataconn(constr As String)    '定义通用过程
    Set myconn = New ADODB.Connection       '实例化各对象类型
    Set myrecor = New ADODB.Recordset
    Set myCmd = New ADODB.Command
    
                                        '进行数据库连接
    myconn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=mybook;Data Source=."

    myconn.Open                         '将打开数据库连接
    myconn.CursorLocation = adUseClient '定义游标类型为客户端
    
    myrecor.CursorType = adOpenDynamic  '设置记录集
    myrecor.LockType = adLockPessimistic
    myrecor.Open constr, myconn


End Sub


⌨️ 快捷键说明

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