Error with Jet 4.0
-
Hi everyone, I've a quest for you. I have to read data from a DBF file using Microsoft Jet 4.0. Connection and data reading are OK up to about 1045 times. From that moment, the driver send always an exception with the message: "System resource exceeded" I've tried to switch to a ODBC driver (through DSN) but the problem still remains. My machine has a WinXP SP2 installed, with SQLServer 2000 SP4. If someone has a tip... Thanks, Vilmer
-
Hi everyone, I've a quest for you. I have to read data from a DBF file using Microsoft Jet 4.0. Connection and data reading are OK up to about 1045 times. From that moment, the driver send always an exception with the message: "System resource exceeded" I've tried to switch to a ODBC driver (through DSN) but the problem still remains. My machine has a WinXP SP2 installed, with SQLServer 2000 SP4. If someone has a tip... Thanks, Vilmer
check this link http://www.codeguru.com/forum/archive/index.php/t-24213-p-2.html
-
check this link http://www.codeguru.com/forum/archive/index.php/t-24213-p-2.html
I found nothing about my problem in that page. I'll try to be more explicit. Here's a sample of my test code: Private Shared WithEvents mtmr_Timer As Timers.Timer Private Shared mstrPath As String Private Shared mstrFile As String Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click If mtmr_Timer Is Nothing Then mtmr_Timer = New Timers.Timer End If AddHandler mtmr_Timer.Elapsed, AddressOf CheckVariable mtmr_Timer.Interval = 500 mtmr_Timer.Start() End Sub Private Shared Sub CheckVariable(ByVal source As Object, ByVal e As ElapsedEventArgs) Dim objConn As Connection Dim objRS As Recordset Try objConn = New Connection objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & mstrPath & ";" & _ "Extended Properties=""DBASE IV;"";" objConn.Open() objRS = New Recordset objRS = objConn.Execute("SELECT top 20 * FROM " & mstrFile & " ORDER BY 1") If Not (objRS.EOF And objRS.BOF) Then objRS.MoveFirst() While Not objRS.EOF objRS.MoveNext() End While End If Catch ex As Exception mtmr_Timer.Stop() MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OKOnly) Finally If Not (objRS Is Nothing) Then objRS.Close() objRS = Nothing End If If Not (objConn Is Nothing) Then If objConn.State = ConnectionState.Open Then objConn.Close() End If objConn.Dispose() End If GC.Collect() End Try End Sub
-
I found nothing about my problem in that page. I'll try to be more explicit. Here's a sample of my test code: Private Shared WithEvents mtmr_Timer As Timers.Timer Private Shared mstrPath As String Private Shared mstrFile As String Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click If mtmr_Timer Is Nothing Then mtmr_Timer = New Timers.Timer End If AddHandler mtmr_Timer.Elapsed, AddressOf CheckVariable mtmr_Timer.Interval = 500 mtmr_Timer.Start() End Sub Private Shared Sub CheckVariable(ByVal source As Object, ByVal e As ElapsedEventArgs) Dim objConn As Connection Dim objRS As Recordset Try objConn = New Connection objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=" & mstrPath & ";" & _ "Extended Properties=""DBASE IV;"";" objConn.Open() objRS = New Recordset objRS = objConn.Execute("SELECT top 20 * FROM " & mstrFile & " ORDER BY 1") If Not (objRS.EOF And objRS.BOF) Then objRS.MoveFirst() While Not objRS.EOF objRS.MoveNext() End While End If Catch ex As Exception mtmr_Timer.Stop() MsgBox(ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.OKOnly) Finally If Not (objRS Is Nothing) Then objRS.Close() objRS = Nothing End If If Not (objConn Is Nothing) Then If objConn.State = ConnectionState.Open Then objConn.Close() End If objConn.Dispose() End If GC.Collect() End Try End Sub
Why are you using the old (COM) ADO classes inside of .Net code? Souldn't you be using System.Data.Oledb classes instead? First, neither Connection nor RS are garbage collected objects, so I presume you are using some kind of wrapper around the MSADO dll. Calling GC.collect (always a bad idea unless you are absolutely certain you must) probably creates the leak, since it is likely that the wrapped com objects don't get released at the right time... (you close the RS object, but don't dispose...and since it is nulled, GC likely collects it... Mixing COM and .Net is not a good thing, and in this case you really don't need to, since .Net classes with even better functionallity exist. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke
-
Why are you using the old (COM) ADO classes inside of .Net code? Souldn't you be using System.Data.Oledb classes instead? First, neither Connection nor RS are garbage collected objects, so I presume you are using some kind of wrapper around the MSADO dll. Calling GC.collect (always a bad idea unless you are absolutely certain you must) probably creates the leak, since it is likely that the wrapped com objects don't get released at the right time... (you close the RS object, but don't dispose...and since it is nulled, GC likely collects it... Mixing COM and .Net is not a good thing, and in this case you really don't need to, since .Net classes with even better functionallity exist. Absolute faith corrupts as absolutely as absolute power Eric Hoffer All that is necessary for the triumph of evil is that good men do nothing. Edmund Burke
I use COM inside .NET because I am just testing ADO with dBase IV files. This sample code is just a test application. The main application where the performance of ADO is critical is written in VBA, so I have to use standard COM objects. During my tests, I have discovered an abnormal behaviour of my test application: I have several standard machines (WinXP SP2, MDAC 2.8, etc...) and in one of them it works properly. It's quite strange because in that one, the driver doesn't accept file names longer than 8 chars (defined as DOS 8.3 standard names). I've checked all drivers version and it seems they are the same in every machine. Does anyone know which package (or settings) could make this possible?