A family of Microsoft relational database management systems designed for ease of use.
I was not able to find any code that creates a database in c++, so at last i used c#. Ported the code.
thanks,
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to create a database in MSAccess 2010 programmatically in C++.
It is being used in a library [which is used by a windows form application].
"ADODB " is used here. I have the code for opening the database.
A family of Microsoft relational database management systems designed for ease of use.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
I was not able to find any code that creates a database in c++, so at last i used c#. Ported the code.
thanks,
thanks for the reply.
Sorry i didn't mention i was looking code in C++
Correction to the code I posted...
In the "cleanup" commands, change objDB.Quit to objDB.Close:
Sub TestDB()
Dim objDb As Database
Dim strPath As String
strPath = "C:\test\Test.accdb"
Set objDb = Application.DBEngine.CreateDatabase(strPath, dbLangGeneral)
' Clean up objects when done...
objDb.Close
Set objDb = Nothing
End Sub
This will create a new database in Access vba:
Dim objDb as Database
dim strPath as string
strPath = "C:\Test.accdb"
Set objDB = Application.DBEngine.CreateDatabase(strPath``, dbLangGeneral)
' Clean up objects when done...
objDB.Quit
Set objDB = nothing