Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Creating a new access database ERROR

Creating a new access database ERROR

Scheduled Pinned Locked Moved Database
helpdatabasequestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Martin captivasystems
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • M Martin captivasystems

      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

      R Offline
      R Offline
      Rob Graham
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • R Rob Graham

        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

        M Offline
        M Offline
        Martin captivasystems
        wrote on last edited by
        #3

        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

        R 1 Reply Last reply
        0
        • M Martin captivasystems

          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

          R Offline
          R Offline
          Rob Graham
          wrote on last edited by
          #4

          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

          M 1 Reply Last reply
          0
          • R Rob Graham

            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

            M Offline
            M Offline
            Martin captivasystems
            wrote on last edited by
            #5

            Thank you

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups