ADOX to create Access DB File results in Memory could not be Writt



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


.



Relevant Pages

  • Re: Record-Locking
    ... It means that as soon as the front end opens, a connection is made to the ... created after Jet reads and deciphers the information from the database file ... Bury the back end file deep in the directory structure on a network ... Another Windows API ...
    (microsoft.public.access.security)
  • VS 2005 Express With SQL 7/2000
    ... Every time I try to set up a connection I end up in that "choose data ... Visual Studio 2005 Express edition? ... (programatically works fine, but I need the server in the server explorer, ...
    (microsoft.public.vsnet.ide)
  • Re: ADO programming
    ... When you set just the right connectionstring from your connection in the ... And beside David Sceppa is even more William Vaughn a regular member of this ... > program cannot find the database file itself (I am using OledB to connect ... > The Connection,dataadaptor and datasets were created using the wizards. ...
    (microsoft.public.dotnet.general)
  • Re: Connection String Problem
    ... > I am trying to create a sql ce database file on a Pocket PC 2002 emulator ... ArgumentException in the line where I create the connection object. ...
    (microsoft.public.sqlserver.ce)
  • Re: connection for the application; VB6, SQL Server 2000
    ... Set oDb = New clsDataBase ... oDb.CreateDb 'method to create above database file ... 'now the following line points to an open connection object on the above ... Dim oRsResultOfQuery as Adodb.Recordset ...
    (microsoft.public.vb.database.ado)