ADOX to create Access DB File results in Memory could not be Writt
- From: "Mike Fisher" <Mike Fisher@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Jun 2005 18:45:01 -0700
Hi,
I'm using COM interop in C# to create an ADOX Catalog class. I create an
Access Database file. I close the connection to the database file that was
automatically created. This is in a Windows Service (NT Service). After this
code executes and the service continues to run for some time, the service
crashes with a "Memory could not be written" error.
ADOX.Catalog databaseCatalog = new ADOX.CatalogClass();
databaseCatalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
dbFilename + ";Jet OLEDB:Engine Type=5");
ADODB.Connection15 defaultConnection = databaseCatalog.ActiveConnection as
ADODB.Connection15;
if(defaultConnection != null)
{
// The following closes the connection, but results in an eventual "memory
could not be written" error
defaultConnection.Close();
}
If I remove the Close() line the service won't crash (but the database file
remains locked for an unpredictable amount of time). Also, running this in a
WinForms application doesn't get this error.
Any ideas?
Thanks,
Mike
.
- Prev by Date: Re: Oracle to Excel Export - Lots of records need speed
- Next by Date: Add record to Access Database
- Previous by thread: Removing Carriage returns
- Next by thread: Add record to Access Database
- Index(es):
Relevant Pages
|
|