计算机应用 | 古代文学 | 市场营销 | 生命科学 | 交通物流 | 财务管理 | 历史学 | 毕业 | 哲学 | 政治 | 财税 | 经济 | 金融 | 审计 | 法学 | 护理学 | 国际经济与贸易
计算机软件 | 新闻传播 | 电子商务 | 土木工程 | 临床医学 | 旅游管理 | 建筑学 | 文学 | 化学 | 数学 | 物理 | 地理 | 理工 | 生命 | 文化 | 企业管理 | 电子信息工程
计算机网络 | 语言文学 | 信息安全 | 工程力学 | 工商管理 | 经济管理 | 计算机 | 机电 | 材料 | 医学 | 药学 | 会计 | 硕士 | 法律 | MBA
现当代文学 | 英美文学 | 通讯工程 | 网络工程 | 行政管理 | 公共管理 | 自动化 | 艺术 | 音乐 | 舞蹈 | 美术 | 本科 | 教育 | 英语 |

电表管理系统VB(一)毕业论文网(7)

2013-05-10 18:08
导读:e holderid'" Trim(txtUserName(0)) "'and delflagtrue " rst.Open sqlEdit, gCnn, adOpenStatic, adLockBatchOptimistic If buttontime = False Then If Not rst.EOF Then txtUserName(0) = rst.Fields(1) txtUserN
e holderid<>'" & Trim(txtUserName(0)) & "'and delflag<>true "
 
    rst.Open sqlEdit, gCnn, adOpenStatic, adLockBatchOptimistic
 
If buttontime = False Then
   
    If Not rst.EOF Then
   
        txtUserName(0) = rst.Fields(1)
        txtUserName(1) = rst.Fields(2)
        txtUserName(2) = rst.Fields!cendcode
        dtpwdate(0).Value = rst.Fields(4)
        buttontime = True
   End If
Else
    rst.MoveNext
    If Not rst.EOF Then
        txtUserName(0) = rst.Fields(1)
        txtUserName(1) = rst.Fields(2)
        txtUserName(2) = rst.Fields!cendcode
        dtpwdate(0).Value = rst.Fields(4)
        buttontime = True
   End If
End If
End Sub

Private Sub txtUserName_KeyPress(Index As Integer, KeyAscii As Integer)
If Index = 9 Then
    If KeyAscii <> 8 And KeyAscii <> 46 And KeyAscii < 48 Or KeyAscii > 57 Then KeyAscii = 0
End If
End Sub

 

数据导入界面设计:

数据导入代码设计:
Private Sub Command1_Click()
On Error GoTo errhandle:
Dim a As String
a = App.Path
a = a & "\"
b = Text1.Text
Dim filename As String
If Dir("" & a & "计费系统数据库.mdb") <> "" Then
Dim ll As String
ll = MsgBox("此目录下有此文件要覆盖吗", vbYesNo, "复制文件")
If ll = vbYes Then

(转载自http://zw.nseac.coM科教作文网)

Kill ("" & a & "计费系统数据库.mdb")
FileCopy "" & Text1.Text & "", "" & a & "计费系统数据库.mdb"
Dim l
l = MsgBox("数据导入成功", vbOKOnly, "提示")
Else
Exit Sub
End If
Else
FileCopy "" & Text1.Text & "", "" & a & "计费系统数据库.mdb"
Dim llp
llp = MsgBox("数据导入成功", vbOKOnly, "提示")
End If
Exit Sub
errhandle:
MsgBox "出现错误,不能复制", vbOKOnly + vbCritical, "复制文件"
End Sub

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


数据删除界面设计:

数据删除代码设计:

Private Sub cmdAsure_Cl

上一篇:地籍登记管理系统+vb(一)毕业论文 下一篇:没有了