错误:无法再打开表 [英] Error : Cannot open any more tables

查看:80
本文介绍了错误:无法再打开表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我们在vb.net中开发了一个多线程应用程序,我们使用的是Microsoft Access Jet引擎4.0。对于数据库当我运行应用程序时,它成功执行但在一段时间后它给出了一个错误无法打开任何更多的表。我们搜索了很多,发现我们必须关闭所有连接和所有读者。并释放所有资源。我们也做到了但它不起作用。所以任何人都可以帮助我们吗?



问候,



Riddhi

解决方案

请参阅 http://support.microsoft.com/kb/304536 [< a href =http://support.microsoft.com/kb/304536target =_ blanktitle =New Window> ^ ]或 http://www.google.com/search?q=Jet+4.0+%22Error+%3A+Cannot+open+any+more+tables%22&sourceid=ie7&rls=com.microsoft:da:IE- SearchBox& ie =& oe = [ ^ ]


听起来像是一些线程同步问题。 Access不是设计为多用户,多线程应用程序。我会考虑切换到SQL Server Express。它是免费的,具有更好的性能和功能,并且可以在必要时轻松升级到完整版。




当从MS Access到mySql时真正改变使用VB.Net将解决这个问题。但我发现了另一种解决这个问题的方法。



i创建了一个名为conState的程序,见下文



 公共  Sub  conState()
如果 con.State = ConnectionState.Closed 那么
con.Open()
结束 如果
结束 Sub



所以在添加任何更新/选择或插入语句之前我添加了



con.close()

致电conState()









 对于 i =  0    datagridview1.rowscount  -   1  
con.close
call conState()
con.Close()
con.Open()

cmd = OleDbCommand( 插入SBCCourses(lvid,stid,course,score,sem)值(' &盖子和盖子 ','&希德& ','& scode& ','& sgrade& ','2'),con)

cmd.ExecuteNonQuery ()
cmd.Dispose()
下一步



我觉得这真的很有帮助


hi,

We have developed one multithreaded application in vb.net and we are using Microsoft Access Jet engine 4.0. for database And when i run the application it execute successfully but after some time it gave an error "Can not open any more table." We searched a lot and we found that we have to close all the connections and all the readers. and release all the resources. we have done that also but its not working. so can any one help us??

Regards,

Riddhi

解决方案

see http://support.microsoft.com/kb/304536[^] or http://www.google.com/search?q=Jet+4.0+%22Error+%3A+Cannot+open+any+more+tables%22&sourceid=ie7&rls=com.microsoft:da:IE-SearchBox&ie=&oe=[^]


Sounds like some thread synchronization issues. Access wasn't designed as a multi-user, multi-threaded application. I would consider switching to SQL Server Express. It is free, has better performance and capabilities and can be easily upgraded to a full version when necessary.


Hi,
Really changing from MS Accesss to mySql when using VB.Net will solve this problem. But i discover another way to get rid of this problem.

i created a procedure called conState see below

Public Sub conState()
        If con.State = ConnectionState.Closed Then
            con.Open()
        End If
End Sub


So before any Update/select or insert statement i added

con.close()
call conState()


Like

For i = 0 to datagridview1.rowscount  - 1
con.close
call conState()
con.Close()
                        con.Open()

                        cmd = New OleDbCommand("insert into SBCCourses (lvid, stid, course , Score , sem) values ('" & Lid & "','" & Sid & "','" & scode & "','" & sgrade & "' , '2' )", con)
                      
                        cmd.ExecuteNonQuery()
                        cmd.Dispose()
Next


I find this really helpfull


这篇关于错误:无法再打开表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆