TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Glenn
NA
10
0
Issues Creating a Access File
Sep 11 2007 3:42 PM
OK, what i am looking to do is have a program that creates a MS Access File. I can get my code create the file, but then when i go to pass the Database to a dao.Database variable so I can add database password and exicute the SQL to create the default tables and data. I am getting a error saying it can't load the type library/DLL.
Here is my code:
private void CreateNewMDB(string Target)
{
Microsoft.Office.Interop.Access.Application oAccess = new Microsoft.Office.Interop.Access.Application();
oAccess.NewCurrentDatabase(Environment.CurrentDirectory + @"\data\" + Target + ".mdb");
dao.Database oData = oAccess.CurrentDb();
oData.NewPassword("", "password");
BuildDefualts(oData, Target);
oData.Close();
oAccess.CloseCurrentDatabase();
}
The part it errors out is "dao.Database oData = oAccess.CurrentDb();". I have all the object refs properly listed. I even tried setting them to copy local. Now i have been hunting and hunting all over the place. All i can ever seem to find is Stuff dealing mostly with Ecel never Access.
Any one have a idea what i have done wrong?
Reply
Answers (
1
)
Excel sheet modification
Basic Qs about references to Word