Skip to main content
GameDev.net gamedev.net
🔒 Locked

C++ and Databases

Started by i_pee_freely Mar 4, 2003 at 11:36 AM 4 replies 450+ views
Original Post
i_pee_freely
i_pee_freely
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]
daerid
daerid
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.
daerid@gmail.com
LNK2001
LNK2001
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"
"-1 x -1 = +1 is stupid and evil."-- Gene Ray
pyttroll
pyttroll
You can also create a File DSN that your application can point to.

Pyt

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.