Private Sub Command2_Click()
dy
Unload Me
End Sub
Private Sub Dir1_Change()
If Right(Dir1.Path, 1) <> "\" Then
Text1.Text = Dir1.Path + "\"
Else
Text1.Text = Dir1.Path
End If
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
If Drive1.Drive = "a:" Then
MsgBox "不能从A盘导入"
Exit Sub
End If
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
Text1.Text = Text1.Text + File1.filename
Command1.Enabled = True
End Sub
Private Sub Form_Activate()
gCnn.Close
Command1.Enabled = False
'Text1.Text = "c:\"
Text1.Text = CurDir()
Text1.Enabled = False
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
dy
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If gCnn.State = 0 Then
gCnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= " & DbPassword & " ;Data Source= " & _
App.Path & "\data\dbdb.mdb;Persist Security Info=False"
gCnn.CursorLocation = adUseClient
gCnn.Open
End If
MDIme.loadAdd
End Sub
7. 数据删除界面设计:
数据删除代码设计:
Private Sub cmdAsure_Click()
If MsgBox(" 你确定要删除该数据吗? ", vbInformation + vbYesNo) <> vbYes Then
Exit Sub
End If
If Trim(MDIme.dcvalue.BoundText) <> "" Then
Dim cnn As New ADODB.Connection
Dim sqlAdd As String
cnn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:database password= " & DbPassword & " ;Data Source= " & _
App.Path & "\data\dbdb.mdb;Persist Security Info=False"
cnn.CursorLocation = adUseClient
cnn.Open
sqlAdd = "update panelinfo set delflag=true"
sqlAdd = sqlAdd & " where holderid='" & Trim(MDIme.dcvalue.BoundText) & "'"
cnn.Execute sqlAdd
cnn.Close
MsgBox " 数据删除完成! ", vbInformation
End If
End Sub
Private Sub Command1_Click()
For i = 0 To 10
If i <> 9 Then
MDIme.txtUserName(i) = ""
End If
Next
MDIme.dcNum = ""
MDIme.dcvalue = ""
Unload Me
End Sub
Private Sub Form_Load()
Dim rst As New ADODB.Recordset
Dim sqlEdit As String
sqlEdit = "select * from panelinfo "
sqlEdit = sqlEdit & " where holderid='" & Trim(MDIme.txtUserName(0)) & "' and delflag<>true "
rst.Open sqlEdit, gCnn, adOpenKeyset, adLockBatchOptimistic
If Not rst.EOF Then
txtUserName(0) = rst.Fields(1)
txtUserName(1) = rst.Fields(2)
txtUserName(2) = rst.Fields(3)
dtpWdate.Value = rst.Fields(4)
txtUserName(3) = rst.Fields(5)
txtUserName(4) = Format(rst.Fields(6), "####0.00")
txtUserName(5) = Format(rst.Fields(7), "####0.00")
txtUserName(6) = rst.Fields(8)
txtUserName(7) = rst.Fields(9)
txtUserName(8) = rst.Fields(10)
txtUserName(9) = rst.Fields!cendcode
changeE = rst.Fields!cendcode
cEcount = rst.Fields!nowecount
If rst.Fields(14) <> Null Then
DTPicker1.Value = rst.Fields(14) End If
txtUserName(10) = rst.Fields!cFeeMoney
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>