I've been using OLEDB programmatically (No References in Visual Studio, just accessing the database, which is in the same folder as the program, through code) to access and modify Microsoft Access databases in Visual Basic. I've always made sure my programs have any required databases already created and packaged with the program, but I have been porting some of my VB programs to C# and was wondering if it was possible to create a database file if the database is lost or deleted.
I've seen a few tutorials on using adding a COM reference to Microsoft ADO Ext. X.X for DLL and SecurityADOX, but I was wondering if there was a way to use OLEDB to create and then instantiate the database.
Something along the lines of checking if the database exists
if (!File.Exists("Database.accdb"))
then some code that isn't ADOX's Catalog.Create
(I've also seen CatalogClass.Create
) but is an OLEDB equivalent, if there is one.
I've read a couple Stack Overflow questions which all say to use ADOX. Even Microsoft's tutorials involve ADOX.
I'm completely open to adding ADOX and still using OLEDB if that's the best course, or even switching to SQLite if it's faster/more efficient, but I was just asking if there's an OLEDB-only way.