?? form1.frm
字號:
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 330
Left = 360
TabIndex = 9
Top = 2040
Width = 1470
End
Begin VB.Label Label8
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "類別:"
Height = 240
Left = 240
TabIndex = 8
Top = 1320
Width = 660
End
Begin VB.Label Label10
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "姓名:"
Height = 240
Left = 3480
TabIndex = 7
Top = 600
Width = 660
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "卡號:"
Height = 240
Index = 0
Left = 240
TabIndex = 6
Top = 480
Width = 660
End
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00E0E0E0&
Caption = "卡號:"
Height = 240
Index = 1
Left = 120
TabIndex = 23
Top = 1080
Width = 660
End
Begin VB.Label Label4
BackColor = &H00E0E0E0&
Caption = "進入人數 "
Height = 255
Index = 0
Left = 6240
TabIndex = 4
Top = 1080
Width = 1095
End
Begin VB.Label Label39
Alignment = 2 'Center
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "0"
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000FF&
Height = 375
Left = 7560
TabIndex = 3
Top = 1080
Width = 975
End
Begin VB.Label Label3
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "宋體"
Size = 15
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00004080&
Height = 375
Left = 4320
TabIndex = 2
Top = 1080
Width = 1695
End
Begin VB.Label Label2
BackColor = &H00E0E0E0&
Caption = "當前時間"
Height = 375
Index = 1
Left = 3000
TabIndex = 1
Top = 1080
Width = 1095
End
Begin VB.Label Label1
BackColor = &H00E0E0E0&
Caption = "海角嬉水樂園會員卡管理系統入口"
BeginProperty Font
Name = "隸書"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 360
TabIndex = 0
Top = 120
Width = 8295
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim row_num As Integer '表格的總行數
Dim col_num As Integer '表格的總列數
Dim gridrow As Integer
Dim mycmd As New ADODB.Command
Dim temp As String
Dim rs5 As New ADODB.Recordset
Private Sub command1_Click()
Dim sql As String
Dim rs4 As New ADODB.Recordset
sql = "delete * from 臨時表"
Set rs4 = conn.Execute(sql)
Unload Me
End Sub
Private Sub command3_Click()
Form3.Show
End Sub
Private Sub Form_Activate()
Text1.SetFocus
End Sub
Private Sub Form_Load()
If username = "guest" Then
command3.Enabled = False
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim sql As String
Dim cmd As New ADODB.Command
select_row = Text1.Text
select_row1 = Text6.Text
On Error GoTo displaybasicerror
Set cmd.ActiveConnection = conn
sql = "select * from 基本檔案 where 基本檔案.卡號=" & "'" & select_row & "'"
cmd.CommandText = sql
Set rs2 = cmd.Execute
If rs2.EOF = True Then
MsgBox "無此卡", vbOKOnly + vbExclamation, ""
Else
Text2.Text = rs2.Fields(0)
Text3.Text = rs2.Fields(1)
Text4.Text = rs2.Fields(9)
Text5.Text = rs2.Fields(7)
Text6.Text = rs2.Fields(8)
If rs2.Fields(13) = "是" Then
MsgBox "此卡已到期", vbOKOnly + vbExclamation, ""
Else
Picture1.Picture = LoadPicture(ReadImage(rs2.Fields("照片")))
sql = " insert into 臨時表 (卡號,注冊時間) values ('" & Text2.Text & "','" & Now & "')"
conn.Execute sql
End If
End If
displaybasicerror:
If Err.Number <> 0 Then
MsgBox Err.Description
End If
Text1.Text = ""
Text1.SetFocus
End If
temp = 0
sql = "select * from 臨時表"
Set rs3 = conn.Execute(sql)
Do While Not rs3.EOF
temp = temp + 1
rs3.MoveNext
Loop
Label39.Caption = temp
End Sub
Private Sub Timer1_Timer()
Label3.Caption = Time
End Sub
Private Function ReadImage(blobColumn As ADODB.Field) As String
'取得一個臨時性文件
Dim strFileName As String
strFileName = "ImageTmp"
Dim FileNumber As Integer '文件號
Dim DataLen As Long '文件長度
Dim Chunks As Long '數據塊數
Dim ChunkAry() As Byte '數據塊數組
Dim ChunkSize As Long '數據塊大小
Dim Fragment As Long '零碎數據大小
Dim lngI As Long '計數器
On Error GoTo errHander
ChunkSize = 20480 '定義塊大小為 20K
If IsNull(blobColumn) Then Exit Function
DataLen = blobColumn.ActualSize '獲得圖像大小
If DataLen < 8 Then Exit Function '圖像大小小于8字節時認為不是圖像信息
FileNumber = FreeFile '產生隨機的文件號
Open strFileName For Binary Access Write As FileNumber '打開存放圖像數據文件
Chunks = DataLen \ ChunkSize '數據塊數
Fragment = DataLen Mod ChunkSize '零碎數據
If Fragment > 0 Then '有零碎數據,則先讀該數據
ReDim ChunkAry(Fragment - 1)
ChunkAry = blobColumn.GetChunk(Fragment)
Put FileNumber, , ChunkAry '寫入文件
End If
ReDim ChunkAry(ChunkSize - 1) '為數據塊重新開辟空間
For lngI = 1 To Chunks '循環讀出所有塊
ChunkAry = blobColumn.GetChunk(ChunkSize) '在數據庫中連續讀數據塊
Put FileNumber, , ChunkAry() '將數據塊寫入文件中
Next lngI
Close FileNumber '關閉文件
ReadImage = strFileName
Exit Function
errHander:
ReadImage = ""
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -