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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database starter

Status
Not open for further replies.

sggaunt

Programmer
Jul 4, 2001
8,620
GB
Hello

So far I have managed to get reasonably proficent in Delphi without doing any more than run the Database Demos!

So here is the problem, we run an acounts/ stock control package called 'Page', but there is no search facility in the stock control section.
Someone suggested that I write a Delphi app to do searches,
Page uses DBase format and has lots of *.CDF and *.DBF files, and that is about the limit of my knowledge.

Can any one give me some basic pointers on how to access and interrogate these files using Delphi's DB components?

Steve.
 
Approach 1.

Set an ODBC DSN (Settings - control panel - Administrative tools - Data sources) for your database (The collection of the .dbf and .cdf files in a directory is the database)

Add the following components to a Delphi form.

TADOConnection
TADODataset
TDataSource
TDBGrid

Set the connection to the DSN, and connect the others to each other in the order given.

Write some SQSL in the TADODataset CommandText property
e.g.
SELECT * FROM Products WHERE ProductID<1000
then set the active property to true.

Approach 2.

Use the BDE instead. Borland recommends the BDE is not used for new applications, but is can be good for DBase tables.

No need to set up a DSN.

Use components:

TDatabase
TQuery
TDatasource
TDBTable

SQL statement goes in TQuery.SQL

Have fun
Simon
 
Thanks for that Vintagewine

I may leave the fun until after christmas (which will be more fun I expect)
Can't do your first suggestion as the TADO componets don't exist in our rather old and cheap Delphi 3 Standard Edition
Just to show how little we know about this subject

We tried to set things up with DBE and keep getting errors.

On trying to set the table active in Delphi 'Your application is not enabled for use with this driver: alias DBFiles'

and when double clicking on DBase files In the BDE 'Cannot load ADAPI Service library IDODBC32.DLL', searched for this file and it dosent seem to exist?.

Steve
 
If there is interest in making your search functionality work (i.e. there is some money to throw your way) you might want to consider upgrading your Delphi. Borland has a deal right now where you can pre-order Delphi 8 and you'll received Delphi 7 Pro when D8 is released. Then you'll have all of the DB tools you'll need.

A cheaper solution is to use MS Access - it will connect to DBase tables without much hassle at all...

Djangman
 
I suspect that IDODBC32.DLL is part of ODBC 32 bit drivers. If you are using older Delphi are you using older windows too? 32 bit ODBC was not always installed by default I seem to remember.

I agree with Djangman: Upgrade as to be the good recommendation.

If you persist with old kit I think that ODBC 32 can be installed by coping files from another computer or from the CD. My memory does not stretch to how <g>.

Happy Christmas
Simon
 
Hmm
Well, considering our current budget, I think an Access Macro, might be the best bet. I dont think the Windows version is the Problem my machine is running XP.

Steve.
 
Try to get a hold on at least Delphi 4 pro and up.
The standard Delphi is very very limited.
Comparing the price class $100 - $800 and $2000+ for the Delphi 3 standard-pro and client server (now enterprise) you will know why.

With the standard edition you can make simple applications but you can not extend the capability of the existing components because the source code is not supplied.

Regards

Steven van Els
SAvanEls@cq-link.sr
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top