Archived

This topic is now archived and is closed to further replies.

i_pee_freely

C++ and Databases

Recommended Posts

I'm in college first of all. I'm doing a proj using c++ and i'm doing database work (Microsoft Access database). Every time i go to a new computer i have to set up the database every time by going into the control panel and messing around with the ODBC data source yoke in admin tools. I have to create a new database every time i go to a different computer. It's a pain in the ass. It's just not set up right on these computers, yeah???? I was wondering is there something i can do, code wise, that will solve the problem. How do i connect to my database using Borland C++ builder version 4.0??? The reason i have to do all that shit above is because i can't connect to the database otherwise. I doubt any1 can help me, i think i may put up with it, i was just chancing my arm *bump* [edited by - I_Pee_Freely on March 5, 2003 9:55:23 AM]

Share this post


Link to post
Share on other sites
Do some research on ActiveX Data Objects and Connection Strings.

I''ve never had to mess around with ODBC Data Source Names for connecting to an Access or SQL Server database.

Share this post


Link to post
Share on other sites
You don''t have to set up a Data Source Name. Instead you can connect through an ODBC connection string.
Look here for examples.

If it''s an Access DB, the cn string will probably look something like this:

"Driver={Microsoft Access Driver (*.mdb)}; Dbq=C:\Blah\MyDB.mdb;Uid=admin;Pwd"

Share this post


Link to post
Share on other sites