📄 创建表.frm
字号:
VERSION 5.00
Begin VB.Form 创建表
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.OLE OLE1
Class = "Excel.Sheet.8"
Height = 735
Left = 600
OleObjectBlob = "创建表.frx":0000
TabIndex = 0
Top = 1320
Width = 2055
End
End
Attribute VB_Name = "创建表"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cn As ADODB.Connection
Dim cmd As ADODB.Command
Dim TableName2 As String
Private Sub Form_Load()
Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
TableName2 = "data" & CInt(Rnd * 10) & "" ''' '随机生成文件名
cn.ConnectionString = "DSN=student"
cn.Open
strsql = "create table " & TableName2 & "(nickname varchar(20),password varchar(20))"
cn.Execute strsql
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -