Link to home
Start Free TrialLog in
Avatar of TimB
TimB

asked on

How and I connect to a .MDB file without ODBC?

I need to wite an MFC dialog based program that can connect to a MS access .MDB file.  The problem is, that I cannot use ODBC - this program will be sent out to many clients who are complete computer novices so I can't get them to set up ODBC data sources.

Does anyone know how I can get around this problem?

- Is DAO the answer? I've heard of it, but don't know anything more.

Any help or pointers would be brilliant.

Thanks for any comments,

TimB
Avatar of Zoppo
Zoppo
Flag of Germany image

Hi TimB,

Just a hint: you could use ODBC and write a small programm which setups the data sources programmatically when installing your software...

ZOPPO
Avatar of TimB
TimB

ASKER

Thanks  Zoppo,

I've found some info here:

http://www.codeguru.com/mfc_database/DAO_non_accessdb.shtml

And it lookslike I may be able to use the CDaoDatabase class.

I'll keep looking,  Thanks again,

TimB
ASKER CERTIFIED SOLUTION
Avatar of balugaa
balugaa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
balugaa changed the proposed answer to a comment
Sorry didnt want to lock the Question
Avatar of TimB

ASKER

Thats ok baluga I didn't mind you answering.  I'm just going thru your code right now.....

Tim
Hi

U can configure ODBC programmatically we have developed apps that use odbc and CDatabase, which is released short time a go and up to now we havenot faced any problems with it  all that U have to do is

1. Have a tamplate to copy it  when ever user asks to create new database.

2. use SQLconfigDatasource(..) to programmatically configure the data source of ODBC (U have to supply drivers with installations).

3. Open database ( U can write an app with or without database support for this.

Hope this helps
Avatar of TimB

ASKER

Thanks balugaa!

I'd figured out some of this myself, but your gude helped loads.

Thanks v. much

TimB