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.
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.