?? ucenter.ctl
字號(hào):
VERSION 5.00
Begin VB.UserControl ucenter
BackStyle = 0 '透明
ClientHeight = 8010
ClientLeft = 0
ClientTop = 0
ClientWidth = 10515
ScaleHeight = 8010
ScaleWidth = 10515
Begin VB.Frame Frame1
Height = 5775
Left = 1440
TabIndex = 0
Top = 840
Width = 7815
Begin VB.CommandButton record
Caption = "確定"
Height = 495
Left = 5400
TabIndex = 12
ToolTipText = "將當(dāng)前車輛登記并存入數(shù)據(jù)庫"
Top = 4320
Width = 1335
End
Begin VB.TextBox remark1
Height = 1095
Left = 2280
TabIndex = 11
Top = 3000
Width = 3255
End
Begin VB.ComboBox Combo1
BeginProperty DataFormat
Type = 0
Format = "2007-05-01 12:00:00"
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
Height = 300
ItemData = "ucenter.ctx":0000
Left = 2280
List = "ucenter.ctx":0002
Locked = -1 'True
TabIndex = 9
Top = 2400
Width = 2655
End
Begin VB.TextBox idval
Height = 495
Left = 2280
Locked = -1 'True
TabIndex = 6
Top = 1800
Width = 2655
End
Begin VB.TextBox dailyid1
Height = 495
Left = 2280
Locked = -1 'True
TabIndex = 5
Top = 1200
Width = 2655
End
Begin VB.Label Label2
Caption = "當(dāng)日序號(hào):"
Height = 375
Left = 840
TabIndex = 2
Top = 1200
Width = 1575
End
Begin VB.Label Label7
Caption = "備注:(選填)"
Height = 375
Left = 840
TabIndex = 10
Top = 3000
Width = 1455
End
Begin VB.Label Label6
Alignment = 2 'Center
Caption = "(只讀,自動(dòng)生成)"
Height = 375
Left = 5280
TabIndex = 8
Top = 1920
Width = 1695
End
Begin VB.Label Label5
Alignment = 2 'Center
Caption = "(只讀,自動(dòng)生成)"
Height = 375
Left = 5280
TabIndex = 7
Top = 1320
Width = 1695
End
Begin VB.Label Label4
Caption = "入場(chǎng)時(shí)間:"
Height = 375
Left = 840
TabIndex = 4
Top = 2400
Width = 1575
End
Begin VB.Label Label3
Caption = "編號(hào):"
Height = 375
Left = 840
TabIndex = 3
Top = 1800
Width = 1815
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "車輛入場(chǎng)登記"
BeginProperty Font
Name = "幼圓"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 495
Left = 1800
TabIndex = 1
Top = 480
Width = 3615
End
End
End
Attribute VB_Name = "ucenter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Private Sub autogenerateparkingno(ByRef ndailyid As Long, ByRef szpkid As String)
Dim rsnext As New ADODB.Recordset
ndailyid = 1
On Error Resume Next
If Not dbcnn.State = ADODB.adStateOpen Then
Exit Sub
End If
Call rsnext.Open("select max(dailyid) as maxpkid from parkinginfo where entertime>Date()", dbcnn, adOpenKeyset, adLockReadOnly)
If rsnext.RecordCount <= 0 Then
ndailyid = 1
Else
ndailyid = rsnext("maxpkid") + 1
End If
szpkid = Format(Year(Now), "0000") + Format(Month(Now), "00") + Format(Day(Now), "00") + Format(ndailyid, "0000")
End Sub
Private Sub Command1_Click()
End Sub
Private Sub record_Click()
Dim sqlstr As String
Dim dailyid2 As String
Dim remark As String
Dim snow As String
Dim szparkingno As String
Dim userid As String
szparkingno = Replace(Trim(idval.Text), "'", "'")
dailyid2 = dailyid1.Text
userid = Replace(usernow.id, "'", "'")
snow = Format(Now, "yyyy-mm-dd hh:mm:ss")
remark = Replace(Trim(remark1.Text), "'", "'")
sqlstr = "insert into parkinginfo" & "(parkingno,dailyid,entertime,parkingrecid,remark)" & "values(" & szparkingno & "," & dailyid2 & "," & "#" & snow & "#," & "'" & userid & "'," & "'" & remark & "');"
dbcnn.Execute (sqlstr)
Call UserControl_Initialize
remark1.Text = ""
addrec (1)
Call UserControl_Initialize
MsgBox "添加記錄成功", , "提示!"
End Sub
Private Sub UserControl_Initialize()
Dim ndailyid As Long
Dim szpkid As String
Call autogenerateparkingno(ndailyid, szpkid)
dailyid1.Text = Format(ndailyid, "0000")
idval.Text = szpkid
Combo1.Text = Format(Now, "yyyy-mm-dd hh:mm:ss")
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -