Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create access database from VB.NET application.
On my machine, MS-Office is installed, and I am using the following code in my application to create Access database..
VB
Dim cat As New ADOX.Catalog
Dim sCreateString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" <database name> & ".mdb"
cat.Create(sCreateString)

On my machine, this code works, but I tried my application on 64-bit machine running windows 7, and MS-Access not installed. I am getting error on following statement.
VB
cat.Create(sCreateString)


Kindly suggest for that, what can I do?
Posted

You need to have your Access DB present on the other machine. cat.Create() in your code above isn't creating an Access DB, it's creating a connection to a DB that already exists.
 
Share this answer
 
Comments
MohanSharma821 3-Oct-13 2:48am    
I am getting the error "Class Not Registered."

Is there any other way to create access database, that is, I don't want to install AccessDB on other machine..??
your application is running on client machine or not.
if not the you can right click on your project solution goto properties in properties change platform to x86 and crate new exe of your application and check .
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900