Creating a new access database ERROR
-
I’m trying to create a new access database and I get an error message that doesn’t make sense. This is the code: Dim cat As New ADOX.Catalog cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\NewDB.mdb") This is the error message: The Microsoft Jet database engine cannot open the file 'c:\newdata.mdb'. It is already opened exclusively by another user, or you need permission to view its data.; operation not complete Doesn’t make sense because: how can it be opened by another user if it doesn’t exists. Why would I need permission to view its data if I am only creating it. Any ideas about this issue? Thanks, Maritn
-
I’m trying to create a new access database and I get an error message that doesn’t make sense. This is the code: Dim cat As New ADOX.Catalog cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\NewDB.mdb") This is the error message: The Microsoft Jet database engine cannot open the file 'c:\newdata.mdb'. It is already opened exclusively by another user, or you need permission to view its data.; operation not complete Doesn’t make sense because: how can it be opened by another user if it doesn’t exists. Why would I need permission to view its data if I am only creating it. Any ideas about this issue? Thanks, Maritn
The equivalent code in C++ works fine for me, except that I am not trying to create the file in the root directory. Try C:\Temp\NewDb.Mdb (make sure that the directory exists and is not write protected). Also mke sure that the file really doesn't exist yet (leftover from previous failure). 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
-
The equivalent code in C++ works fine for me, except that I am not trying to create the file in the root directory. Try C:\Temp\NewDb.Mdb (make sure that the directory exists and is not write protected). Also mke sure that the file really doesn't exist yet (leftover from previous failure). 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
This worked: Try C:\Temp\NewDb.Mdb Why is it that it can not be created in C:\ ? Something else: how can I check if the access database exists and how can I deleted? Thanks Rob, Martin
-
This worked: Try C:\Temp\NewDb.Mdb Why is it that it can not be created in C:\ ? Something else: how can I check if the access database exists and how can I deleted? Thanks Rob, Martin
Security on the root directory typically permits only administrators/system to write there...
// --C# -- if(System.IO.File.Exists(@"C:\Temp\NewDb.mdb") { try { System.IO.File.Delete(@"C:\Temp\NewDb.mdb"); } catch(System.SystemException e) { System.Diagnostics.Trace.WriteLine("Delete failed: " + e.Message); } }
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 -
Security on the root directory typically permits only administrators/system to write there...
// --C# -- if(System.IO.File.Exists(@"C:\Temp\NewDb.mdb") { try { System.IO.File.Delete(@"C:\Temp\NewDb.mdb"); } catch(System.SystemException e) { System.Diagnostics.Trace.WriteLine("Delete failed: " + e.Message); } }
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 BurkeThank you