又来请教各位前辈了
vb+access数据库遇到的问题我的程序里有很多窗体
不过大致的结构都相同
其中一个窗体的代码如下Dim dt As Date
Dim OpenWs As Workspace
Dim OpenDB As Database
Dim rs1
Dim rs2
Dim rs3
Dim rs4
Dim rs5
Dim rs6
Dim rs7Private Sub Form_Load()
    dt = Now
    Text103.Text = Format(dt - 1, "YYYY-MM-DD")
    Text102.Text = Format(dt - 2, "YYYY-MM-DD")
    Text101.Text = Format(dt - 3, "YYYY-MM-DD")
    Text100.Text = Format(dt - 4, "YYYY-MM-DD")
    Text99.Text = Format(dt - 5, "YYYY-MM-DD")
    Text98.Text = Format(dt - 6, "YYYY-MM-DD")
    Text97.Text = Format(dt - 7, "YYYY-MM-DD")
    t = Format(dt - 7, "YYYY-MM-DD")
    Me.Left = (frmMDI.Width - Me.Width) / 2
    Me.Top = (frmMDI.Height - Me.Height) / 2
    Set OpenWs = DBEngine.Workspaces(0)
    Set OpenDB = OpenWs.OpenDatabase("D:\0729tx\mcdata.mdb", _
 False, False, "MS Access;PWD=kecwdowntime") '(App.Path & "\mcdata.mdb", False, False, ";pwd=kecwdowntime")    'USV#1
    Set rs1 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text97.Text & "') group by department ")
    Set rs2 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text98.Text & "') group by department ")
    Set rs3 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text99.Text & "') group by department ")
    Set rs4 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text100.Text & "') group by department ")
    Set rs5 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text101.Text & "') group by department ")
    Set rs6 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text102.Text & "') group by department ")
    Set rs7 = OpenDB.OpenRecordset("select sum(downtime) as tt from downtime where (department='SMD') and (project='bond') and (pkg='usv') and (line='1') and (date = '" & Text103.Text & "') group by department ")
      
    'USV#1
    If rs1.EOF And rs1.BOF Then
       Text1.Text = 0
    Else
    Text1.Text = rs1.Fields("tt")
    End If
    
    If rs2.EOF And rs2.BOF Then
       Text2.Text = 0
    Else
    Text2.Text = rs2.Fields("tt")
    End If
    
    If rs3.EOF And rs3.BOF Then
       Text3.Text = 0
    Else
    Text3.Text = rs3.Fields("tt")
    End If
    
    If rs4.EOF And rs4.BOF Then
       Text4.Text = 0
    Else
    Text4.Text = rs4.Fields("tt")
    End If
    
    If rs5.EOF And rs5.BOF Then
       Text5.Text = 0
    Else
    Text5.Text = rs5.Fields("tt")
    End If
    
    If rs6.EOF And rs6.BOF Then
       Text6.Text = 0
    Else
    Text6.Text = rs6.Fields("tt")
    End If
    
    If rs7.EOF And rs7.BOF Then
       Text7.Text = 0
    Else
    Text7.Text = rs7.Fields("tt")
    End If
    Text36.Text = (Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) + Val(Text4.Text) + Val(Text5.Text) + Val(Text6.Text) + Val(Text7.Text)) / 7End Sub其他的窗体中程序机构都类似,不过其他的窗体都rs数据集定义的比较多了 最多的定义到了rs1~rs70。程序短时间运行都ok,但是运行一会后,打开多个窗题(打开一个,关闭,再打开其他的窗体)后,就会有错误,提示如下:         实时错误'3014'
        不能在打开其他的表了。现小弟特来求助各位前辈,有知道问题所在的请指点一下,万分感谢。