Problem with .ldb file

venu.dil

New member
Joined
Oct 22, 2008
Messages
2
Programming Experience
1-3
I am using 'ADOX.Catalog' namespace and the following code to create a new MS Access database.

Private Function CreateAccessDatabase() As Boolean
'-------------------------------------------------------
'This method is called to create a new Access database
'Required: NewDBConnectionString
'-------------------------------------------------------
Dim ADOXCatalog As New ADOX.Catalog
Try
If Me.NewDBConnectionString.Trim.ToString.Length = 0 Then Throw New Exception("Connection string is not specified")

'Call create method to create a new database
ADOXCatalog.Create(Me.NewDBConnectionString.Trim.ToString)
Return True
Catch ex As Exception
Throw ex
Return False
Finally
If Not ADOXCatalog Is Nothing Then
ADOXCatalog = Nothing
End If
End Try

End Function


The moment it created database, it is also leaving a .ldb file in the same directory. I don't want that .ldb file. If I tried to delete the file forcedly, it is passing an exception "The file is being used....". All the connection strings are properly closed.

Can anyone help me to remove this .ldb file.
 
An .ldb file is created everytime you open an access database. It can't be deleted until you close the access database or close the process that created it.
 
At the end of the create process the .ldb file still existing, untill the whole application is closed the .ldb file existing.
 
Saying you want to delet the LDB because you don't want it is like saying you object to some of microsoft's business practices so you want to delete windows, but still run Microsoft Word.. You can't get rid of a file that the Jet engine needs to function. Leave it alone and pursue more important things
 
Back
Top