📄 form9.frm
字号:
VERSION 5.00
Begin VB.Form Form9
BorderStyle = 0 'None
Caption = "Form9"
ClientHeight = 6000
ClientLeft = 0
ClientTop = 0
ClientWidth = 3000
LinkTopic = "Form9"
Picture = "Form9.frx":0000
ScaleHeight = 6000
ScaleWidth = 3000
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Default = -1 'True
Height = 375
Left = 2160
TabIndex = 3
Top = -3000
Width = 615
End
Begin VB.TextBox Text3
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 1560
PasswordChar = "*"
TabIndex = 2
Top = 4210
Width = 1215
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 1
Top = 3810
Width = 1215
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
Height = 270
Left = 1560
TabIndex = 0
Top = 3410
Width = 1215
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 255
Left = 1080
MouseIcon = "Form9.frx":1566A
MousePointer = 99 'Custom
Top = 4700
Width = 615
End
End
Attribute VB_Name = "Form9"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Call Image1_Click
End Sub
Private Sub Form_Load()
Form9.Top = form2.Top + 2760
Form9.Left = 11420
End Sub
Private Sub Image1_Click()
If Text1.Text = "" Or Text2.Text = "" Then
MsgBox "输入数据不完整!"
Else
server = Text1.Text
loginname = Text2.Text
If Text3.Text <> "" Then
password = Text3.Text
End If
tkOpenSQLServerDB server, "tushu", loginname, password
qy1.AddNew
qy1.Fields(0) = Text1.Text
qy1.Fields(1) = Text2.Text
qy1.Fields(2) = Text3.Text
qy1.Update
cnn1.Close
form2.Height = 0
form2.Width = 0
Form9.Height = 0
Form9.Width = 0
form3.Show
End If
End Sub
Private Sub tkOpenSQLServerDB( _
tkServerName As String, _
tkDefaultDatabase As String, _
tkUserID As String, _
tkPassword As String _
)
On Error GoTo tkFinish
On Error GoTo tkFinish
cnn.Open "Provider=SQLOLEDB.1;" & _
"Data Source=" & tkServerName & ";" & _
"Use Procedure for Prepare=1;" & _
"Auto Translate=True;" & _
"Packet Size=4096;" & _
"Use Encryption for Data=False;" & _
"Tag with column collation when possible=False", _
tkUserID, _
tkPassword
cnn.DefaultDatabase = tkDefaultDatabase
Exit Sub
tkFinish:
MsgBox Err.Description
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -