📄 zhuce.frm
字号:
VERSION 5.00
Begin VB.Form zhuce
Caption = "注册窗口"
ClientHeight = 5055
ClientLeft = 60
ClientTop = 405
ClientWidth = 4785
LinkTopic = "Form2"
ScaleHeight = 5055
ScaleWidth = 4785
StartUpPosition = 3 'Windows Default
Begin VB.TextBox Text7
Height = 375
IMEMode = 3 'DISABLE
Left = 2880
PasswordChar = "*"
TabIndex = 18
Top = 1200
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 2760
TabIndex = 16
Top = 4320
Width = 975
End
Begin VB.CommandButton Command2
Caption = "返回上一层"
Height = 495
Left = 1560
TabIndex = 15
Top = 4320
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 495
Left = 360
TabIndex = 14
Top = 4320
Width = 855
End
Begin VB.TextBox Text6
Height = 495
Left = 1320
TabIndex = 13
Top = 3600
Width = 1935
End
Begin VB.TextBox Text5
Height = 495
Left = 1200
TabIndex = 12
Top = 3000
Width = 1335
End
Begin VB.TextBox Text4
Height = 375
Left = 1320
TabIndex = 11
Top = 2520
Width = 2175
End
Begin VB.TextBox Text3
Height = 495
Left = 1080
TabIndex = 10
Top = 1800
Width = 2175
End
Begin VB.TextBox Text2
Height = 375
Left = 1080
TabIndex = 9
Top = 1320
Width = 855
End
Begin VB.ComboBox Combo1
Height = 315
ItemData = "zhuce.frx":0000
Left = 1080
List = "zhuce.frx":000A
TabIndex = 8
Text = "男"
Top = 840
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 1080
TabIndex = 7
Top = 120
Width = 1215
End
Begin VB.Label Label9
Caption = "(用户名)"
Height = 255
Left = 3360
TabIndex = 19
Top = 1920
Width = 1215
End
Begin VB.Label Label8
Caption = "密码:"
Height = 375
Left = 2160
TabIndex = 17
Top = 1320
Width = 735
End
Begin VB.Label Label7
Caption = "居住地址:"
Height = 375
Left = 360
TabIndex = 6
Top = 3720
Width = 975
End
Begin VB.Label Label6
Caption = "职业:"
Height = 375
Left = 360
TabIndex = 5
Top = 3135
Width = 615
End
Begin VB.Label Label5
Caption = "联系电话:"
Height = 375
Left = 360
TabIndex = 4
Top = 2565
Width = 975
End
Begin VB.Label Label4
Caption = "身份证:"
Height = 375
Left = 360
TabIndex = 3
Top = 1980
Width = 855
End
Begin VB.Label Label3
Caption = "年龄:"
Height = 375
Left = 360
TabIndex = 2
Top = 1395
Width = 615
End
Begin VB.Label Label2
Caption = "性别:"
Height = 375
Left = 360
TabIndex = 1
Top = 825
Width = 615
End
Begin VB.Label Label1
Caption = "姓名:"
Height = 375
Left = 360
TabIndex = 0
Top = 240
Width = 615
End
End
Attribute VB_Name = "zhuce"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New ADODB.Connection
Dim rst As ADODB.Recordset
Dim cmm As ADODB.Command
Private Sub Command1_Click()
Dim textSQL As String
' Call databaseopen
If Text1.Text = "" Then
MsgBox "姓名不能为空!", vbOKOnly + vbExclamation, "警告"
Text1.SetFocus
Exit Sub
Else
If Text2.Text = "" Then
MsgBox "年龄不能为空!", vbOKOnly + vbExclamation, "警告"
Text2.SetFocus
Exit Sub
Else
If Text3.Text = "" Then
MsgBox "身份证不能为空!", vbOKOnly + vbExclamation, "警告"
Text3.SetFocus
Exit Sub
Else
If Text4.Text = "" Then
MsgBox "联系电话不能为空!", vbOKOnly + vbExclamation, "警告"
Text4.SetFocus
Exit Sub
Else
If Text5.Text = "" Then
MsgBox "职业不能为空!", vbOKOnly + vbExclamation, "警告"
Text5.SetFocus
Exit Sub
Else
If Text6.Text = "" Then
MsgBox "居住地址不能为空!", vbOKOnly + vbExclamation, "警告"
Text6.SetFocus
Exit Sub
Else
If Text7.Text = "" Then
MsgBox "密码不能为空!", vbOKOnly + vbExclamation, "警告"
Text7.SetFocus
Exit Sub
Else
Dim RS1, RS2 As New ADODB.Recordset
textSQL = "select * from traveller where 身份证='" & Text3.Text & "'"
Set rst = New ADODB.Recordset
rst.Open Trim$(textSQL), conn
If rst.EOF = True And rst.BOF = True Then
'text1SQL = "insert into user_inf values('" & Trim(Text3.Text) & "','" & Trim(Text7.Text) & "')"
Set RS1 = conn.Execute("exec zhuceinf" _
& "'" & Text3.Text & "'," _
& "'" & Text1.Text & "'," _
& "'" & Combo1.Text & "'," _
& "'" & Text2.Text & "'," _
& "'" & Text6.Text & "'," _
& "'" & Text4.Text & "'," _
& "'" & Text5.Text & "'")
Set RS2 = conn.Execute("exec userinf" _
& "'" & Text3.Text & "'," _
& "'" & Text7.Text & "'")
MsgBox "注册成功!", vbOKOnly + vbExclamation, "提示"
'Call databaseclose
conn.Close
Else
MsgBox "此身份证已存在,请重新输入!", vbOKOnly + vbExclamation, "警告"
Text3.Text = ""
Text3.SetFocus
Exit Sub
End If
End If
End If
End If
End If
End If
End If
End If
End Sub
Private Sub Command2_Click()
Form1.Show
Unload Me
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Combo1.Text = "男"
End Sub
Private Sub Form_Load()
Dim ConnectString As String
Set conn = New ADODB.Connection
ConnectString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;" _
& "Persist Security Info=False;Initial Catalog=陈念;" _
& "Data Source=3302A68391D44A0"
conn.CursorLocation = adUseClient
conn.Open ConnectString
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -