📄 frmconn2master.frm
字号:
VERSION 5.00
Begin VB.Form FrmConn2Master
Caption = "Form1"
ClientHeight = 5745
ClientLeft = 1635
ClientTop = 1530
ClientWidth = 6420
LinkTopic = "Form1"
ScaleHeight = 5745
ScaleWidth = 6420
Begin VB.CommandButton cmdCreateDB
Caption = "&C 建立数据库 DBABC"
Height = 510
Left = 1275
TabIndex = 1
Top = 2790
Width = 3915
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "连接到 Master 数据库"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 300
TabIndex = 0
Top = 315
Width = 4410
End
End
Attribute VB_Name = "FrmConn2Master"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCreateDB_Click()
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.ConnectionString = _
"Provider=SQLOLEDB.1;" _
& "Persist Security Info=False;" _
& "User ID=sa;" _
& "Initial Catalog=master;" _
& "Data Source=SQLSERVER"
conn.Execute "CREATE DATABASE TestDB"
End Sub
Private Sub Form_Load()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -