Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 2-Aug-16 8:58am
v2

 
Share this answer
 
v2
Comments
Espen Harlinn 15-Oct-11 4:27am    
My 5 - That's why I really don't like Access for professional development
Simon Bang Terkildsen 15-Oct-11 14:04pm    
True, though I'm sure Access has it's uses, I just don't know of any :D
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.
 
Share this answer
 
Comments
Simon Bang Terkildsen 14-Oct-11 9:16am    
Sound advice
Espen Harlinn 15-Oct-11 4:25am    
I agree, my 5
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

VB
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

VB
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
 
Share this answer
 
Comments
Richard Deeming 2-Aug-16 15:08pm    
This question was asked, answered, and solved, nearly FIVE YEARS AGO.

And your "solution" is vulnerable to SQL Injection[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900