Vb.net Connection String for Ms Access Database

风流意气都作罢 提交于 2019-12-01 14:22:52

connectionstrings.com is a wonderful thing:

Standard security

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;

With database password

This is the connection string to use when you have an Access 2007 database protected with a password using the "Set Database Password" function in Access.

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Jet OLEDB:Database Password=MyDbPassword;

Some reports of problems with password longer than 14 characters. Also that some characters might cause trouble. If you are having problems, try change password to a short one with normal characters.

DataDirectory functionality

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\myAccess2007file.accdb;Persist Security Info=False;

You may use Server Explorer of Visual Studio to get the connection string or take a look at the connection string.

www.connectionstrings.com

this is a good site for connection strings for almost any application

Dimuth De Zoysa

Did you connect to the database by using 'Tools->Connect to database' ?

If you have already done the above, try this:

Go to server explorer. And select connected database -> In its properties there is a connection string -> Copy it and paste into your code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!