Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to a DataBase

Status
Not open for further replies.

801119

Programmer
Apr 10, 2000
311
SE
Hey all!!

Could someone guide me into connecting to a database?
Is there to connect by code only(without database forms)?
I know this can be done, with a few lines of code, in Visual Basic but is there a simple way in C++?

Thanks!

Martin G Broman
mgb_svea@hotmail.com

DWS - Alpha Whitin Dead Wolf Society
 
I've used databases in several of my programs. I'm not sure if my solution is the one you're talking about. But you simply need the TTable and TDataSource components to set up the database.
In the Object Inspector, set the properties for TTable to these values

property value

DatabaseName "name of database" a diskfile
TableName "name of table" use in your code
Active False True when finished

set the properties for TDataSource to these values

property value

AutoEdit False
DataSet "table1"

If needed you use TEdit to enter values in your database. However, the VCL on the data access tab has many components for databases that you can use, as well as components for SQL data access.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top