首页上一页 1 下一页尾页 2 条记录 1/1页
问问题!急!!!关于“企业文档管理系统”
发表在VB答疑区
2008-08-23
是否精华
是
否
版块置顶:
是
否
您好!问您几个问题
我用的是“VB应用开发完全手册”光盘中的“企业文档管理系统”,是ACCESS版本的。
我是初学者,最近要急用这个程序做毕业论文答辩,所以希望您能帮帮忙,回答得详细些。
一、“文档打印”功能不能实现。
单击工具栏上的“文档打印”,输入查询信息后,符合要求的文档名称列表出现了,但程序不让选某个文档,我又单击一下“打印”按钮,出现错误信息“运行时错误'424'需要对象”。
是不是没有添加控件,如Data Environment,Data Report?
下面是光盘中附带的打印程序,希望您给修改一下,能让这个功能实现。
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Private Sub Cmd_cx_Click()
Dim Str_SubItems As ListItem
If Combo1.Text = "" Or Combo1.Text = "所有类别" Then '从所有类别中查询
AdoRs.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%'", Cnn, adOpenKeyset
Else '按照所选类别查询
AdoRs.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%' and SSLB='" & Combo1.Text & "'", Cnn, adOpenKeyset
End If
If AdoRs.RecordCount > 0 Then
ListView1.ListItems.Clear
AdoRs.MoveFirst
For i = 1 To AdoRs.RecordCount
Set Str_SubItems = ListView1.ListItems.Add()
With Str_SubItems
.Text = AdoRs!SSLB
.SubItems(1) = AdoRs!WDBT
.SubItems(2) = AdoRs!RLSJ
AdoRs.MoveNext
End With
Next i
Else
MsgBox "没有符合条件的信息", 64, "提示信息"
End If
AdoRs.Close
End Sub
Private Sub Cmd_dy_Click()
If Combo1.Text = "" Or Combo1.Text = "所有类别" Then '从所有类别中查询
DataEnvironment1.rsCommand1.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%'", Cnn, adOpenKeyset
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
DataReport1.Show 1
Else
MsgBox "没有要打印的相关信息", 48, "提示信息"
DataEnvironment1.rsCommand1.Close
End If
Else
DataEnvironment1.rsCommand1.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%' and SSLB='" & Combo1.Text & "'", Cnn, adOpenKeyset
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
DataReport1.Show 1
Else
MsgBox "没有要打印的相关信息", 48, "提示信息"
DataEnvironment1.rsCommand1.Close
End If
End If
End Sub
Private Sub Cmd_exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
AdoRs.Open "select * from tb_wdlb order by Bh", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveFirst
Combo1.AddItem "所有类别"
Do While AdoRs.EOF = False '添加文档类别
Combo1.AddItem AdoRs.Fields("Mc")
AdoRs.MoveNext
Loop
End If
AdoRs.Close
AdoRs1.Open "select * from tb_TempDoc", Cnn, adOpenKeyset
If AdoRs1.RecordCount > 0 Then
ListView1.ListItems.Clear
AdoRs1.MoveFirst
For i = 1 To AdoRs1.RecordCount
Set Str_SubItems = ListView1.ListItems.Add()
With Str_SubItems
.Text = AdoRs1!SSLB
.SubItems(1) = AdoRs1!WDBT
.SubItems(2) = AdoRs1!RLSJ
AdoRs1.MoveNext
End With
Next i
End If
AdoRs1.Close
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Cmd_cx_Click
End If
End Sub
二、程序不能连续修改文档:修改一个文档后,再修改第二个文档,出现“修改失败”对话框。怎样解决?
三、ACCESS版本中“工作站设置”有什么用,能实现什么功能,能给写一下步骤吗?单击“工作站设置”,程序没反应。下面是“工作站设置”的程序,请修改一下,使其实现功能。
'提取计算机名和用户名
Dim Computer_str As String * 256
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Cmd_Con_Click()
If Text1.Text = "" Then
MsgBox "请输入服务器名称", 48, "提示信息"
Else
Open (App.Path & "\Setup.ini") For Output As #1
Print #1, Text1.Text
Close #1
MsgBox "保存成功", 64, "提示信息"
If TempNum = 1 Then
MsgBox "服务器配置完成,请您重新运行程序", 64, "提示信息"
Else
Call dl
End If
End If
End Sub
Private Sub Cmd_exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
GetComputerName Computer_str, 255
Txt_Temp.Text = Computer_str
On Error GoTo x
CompturName = Txt_Temp.Text
Open (App.Path & "\Setup.ini") For Input As #1
Line Input #1, Intext
ReadCompturName = Intext
Text1.Text = ReadCompturName
Close #1
If TempNum = 1 Then Exit Sub
If ReadCompturName <> "" Then
Call dl
End If
Exit Sub
x:
Close #1
End Sub
Private Sub dl()
frm_xtdl.Show
Unload Me
End Sub
四、程序中“数据备份”的功能也不能实现,输入文件名称,单击数据备份,出现错误信息“运行时错误-2147467259 (80004005)'[DBNETLIB][connectionopen(connect()).]SQL server 不存在或拒绝访问”
希望您给修改一下,能实现这个功能。
写一下实现这个功能的步骤。
下面是“数据备份”的程序内容,请您修改一下,以实现该功能。
Dim StrCnn As New Connection '定义连接
Dim key, list, sql As String '定义字符串变量
Private Sub Cmd_BackUp_Click()
Cmd_BackUp.Enabled = False
Me.MousePointer = 11
If Text1.Text = "" Then
MsgBox "请您选择数据库备份的路径!", 64, "提示信息"
Else
Dim connter As Integer
Dim sql, workarea(6) As String
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For connter = LBound(workarea) To UBound(workarea)
workarea(connter) = "initial value" & connter
ProgressBar1.Value = connter
StrCnn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_Document"
sql = "backup DATABASE db_Document TO disk='" & Text1.Text & "'"
StrCnn.Execute (sql) '执行SQL语句
StrCnn.Close
Next connter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库备份成功!!", 64, "提示信息"
Cmd_BackUp.Enabled = True
Me.MousePointer = 0
End If
End Sub
Private Sub Cmd_cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Select_Click()
CommonDialog1.Filter = "备份文件(*.bak)|*.bak|文本文件(*.txt)|*.txt|ALL File(*.*)|*.*"
CommonDialog1.ShowSave
Text1.Text = CommonDialog1.FileName
End Sub
五、单击“数据恢复”,出现错误信息,“运行时错误'53'文件未找到”
没有“数据恢复”的程序,如何实现该功能?
我用的是“VB应用开发完全手册”光盘中的“企业文档管理系统”,是ACCESS版本的。
我是初学者,最近要急用这个程序做毕业论文答辩,所以希望您能帮帮忙,回答得详细些。
一、“文档打印”功能不能实现。
单击工具栏上的“文档打印”,输入查询信息后,符合要求的文档名称列表出现了,但程序不让选某个文档,我又单击一下“打印”按钮,出现错误信息“运行时错误'424'需要对象”。
是不是没有添加控件,如Data Environment,Data Report?
下面是光盘中附带的打印程序,希望您给修改一下,能让这个功能实现。
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
Private Sub Cmd_cx_Click()
Dim Str_SubItems As ListItem
If Combo1.Text = "" Or Combo1.Text = "所有类别" Then '从所有类别中查询
AdoRs.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%'", Cnn, adOpenKeyset
Else '按照所选类别查询
AdoRs.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%' and SSLB='" & Combo1.Text & "'", Cnn, adOpenKeyset
End If
If AdoRs.RecordCount > 0 Then
ListView1.ListItems.Clear
AdoRs.MoveFirst
For i = 1 To AdoRs.RecordCount
Set Str_SubItems = ListView1.ListItems.Add()
With Str_SubItems
.Text = AdoRs!SSLB
.SubItems(1) = AdoRs!WDBT
.SubItems(2) = AdoRs!RLSJ
AdoRs.MoveNext
End With
Next i
Else
MsgBox "没有符合条件的信息", 64, "提示信息"
End If
AdoRs.Close
End Sub
Private Sub Cmd_dy_Click()
If Combo1.Text = "" Or Combo1.Text = "所有类别" Then '从所有类别中查询
DataEnvironment1.rsCommand1.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%'", Cnn, adOpenKeyset
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
DataReport1.Show 1
Else
MsgBox "没有要打印的相关信息", 48, "提示信息"
DataEnvironment1.rsCommand1.Close
End If
Else
DataEnvironment1.rsCommand1.Open "select * from tb_TempDoc where WDBT Like '%" & Text1.Text & "%' and SSLB='" & Combo1.Text & "'", Cnn, adOpenKeyset
If DataEnvironment1.rsCommand1.RecordCount > 0 Then
DataReport1.Show 1
Else
MsgBox "没有要打印的相关信息", 48, "提示信息"
DataEnvironment1.rsCommand1.Close
End If
End If
End Sub
Private Sub Cmd_exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
On Error Resume Next
AdoRs.Open "select * from tb_wdlb order by Bh", Cnn, adOpenKeyset
If AdoRs.RecordCount > 0 Then
AdoRs.MoveFirst
Combo1.AddItem "所有类别"
Do While AdoRs.EOF = False '添加文档类别
Combo1.AddItem AdoRs.Fields("Mc")
AdoRs.MoveNext
Loop
End If
AdoRs.Close
AdoRs1.Open "select * from tb_TempDoc", Cnn, adOpenKeyset
If AdoRs1.RecordCount > 0 Then
ListView1.ListItems.Clear
AdoRs1.MoveFirst
For i = 1 To AdoRs1.RecordCount
Set Str_SubItems = ListView1.ListItems.Add()
With Str_SubItems
.Text = AdoRs1!SSLB
.SubItems(1) = AdoRs1!WDBT
.SubItems(2) = AdoRs1!RLSJ
AdoRs1.MoveNext
End With
Next i
End If
AdoRs1.Close
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Cmd_cx_Click
End If
End Sub
二、程序不能连续修改文档:修改一个文档后,再修改第二个文档,出现“修改失败”对话框。怎样解决?
三、ACCESS版本中“工作站设置”有什么用,能实现什么功能,能给写一下步骤吗?单击“工作站设置”,程序没反应。下面是“工作站设置”的程序,请修改一下,使其实现功能。
'提取计算机名和用户名
Dim Computer_str As String * 256
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Sub Cmd_Con_Click()
If Text1.Text = "" Then
MsgBox "请输入服务器名称", 48, "提示信息"
Else
Open (App.Path & "\Setup.ini") For Output As #1
Print #1, Text1.Text
Close #1
MsgBox "保存成功", 64, "提示信息"
If TempNum = 1 Then
MsgBox "服务器配置完成,请您重新运行程序", 64, "提示信息"
Else
Call dl
End If
End If
End Sub
Private Sub Cmd_exit_Click()
Unload Me
End Sub
Private Sub Form_Load()
GetComputerName Computer_str, 255
Txt_Temp.Text = Computer_str
On Error GoTo x
CompturName = Txt_Temp.Text
Open (App.Path & "\Setup.ini") For Input As #1
Line Input #1, Intext
ReadCompturName = Intext
Text1.Text = ReadCompturName
Close #1
If TempNum = 1 Then Exit Sub
If ReadCompturName <> "" Then
Call dl
End If
Exit Sub
x:
Close #1
End Sub
Private Sub dl()
frm_xtdl.Show
Unload Me
End Sub
四、程序中“数据备份”的功能也不能实现,输入文件名称,单击数据备份,出现错误信息“运行时错误-2147467259 (80004005)'[DBNETLIB][connectionopen(connect()).]SQL server 不存在或拒绝访问”
希望您给修改一下,能实现这个功能。
写一下实现这个功能的步骤。
下面是“数据备份”的程序内容,请您修改一下,以实现该功能。
Dim StrCnn As New Connection '定义连接
Dim key, list, sql As String '定义字符串变量
Private Sub Cmd_BackUp_Click()
Cmd_BackUp.Enabled = False
Me.MousePointer = 11
If Text1.Text = "" Then
MsgBox "请您选择数据库备份的路径!", 64, "提示信息"
Else
Dim connter As Integer
Dim sql, workarea(6) As String
ProgressBar1.Visible = True
ProgressBar1.Max = UBound(workarea)
ProgressBar1.Value = ProgressBar1.Min
For connter = LBound(workarea) To UBound(workarea)
workarea(connter) = "initial value" & connter
ProgressBar1.Value = connter
StrCnn.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_Document"
sql = "backup DATABASE db_Document TO disk='" & Text1.Text & "'"
StrCnn.Execute (sql) '执行SQL语句
StrCnn.Close
Next connter
ProgressBar1.Value = ProgressBar1.Min
MsgBox "数据库备份成功!!", 64, "提示信息"
Cmd_BackUp.Enabled = True
Me.MousePointer = 0
End If
End Sub
Private Sub Cmd_cancel_Click()
Unload Me
End Sub
Private Sub Cmd_Select_Click()
CommonDialog1.Filter = "备份文件(*.bak)|*.bak|文本文件(*.txt)|*.txt|ALL File(*.*)|*.*"
CommonDialog1.ShowSave
Text1.Text = CommonDialog1.FileName
End Sub
五、单击“数据恢复”,出现错误信息,“运行时错误'53'文件未找到”
没有“数据恢复”的程序,如何实现该功能?