Solved

BDE specific

Posted on 1997-10-12
4
459 Views
Last Modified: 2012-05-04
Hello
I am using C++ -> BDE -> SQL links -> MSSQL

I need a BDE specific answer. When using BDE to access MSSQL, how should I go about getting the result sets. As far as I can tell you have to call a series of DBI functions, i.e.
(In this order of calling)
DbiQAlloc
DbiQPrepare
DbiQSetParams
DbiQExec
DbiQInstantiateAnswer

Is this the right way to go about using BDE to get the result sets from MSSQL, or is there another way?

Thanks Eban.
0
Comment
Question by:eban
  • 2
  • 2
4 Comments
 

Author Comment

by:eban
Comment Utility
Adjusted points to 100
0
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 100 total points
Comment Utility
Eban,

This sounds like the correct approach to me. Just make sure you release the DB Handle when you don't need it anymore.

Good luck with your project!
Pegasus

0
 

Author Comment

by:eban
Comment Utility
Thank for your comment Pegasus,

Is this the way you use BDE with MSSQL? I am not sure but are there any other ways of doing it. Is it better to use native handles to the tables? I read that it could be but I really don't understand what native handles are. I am finding the operations slow doing it with the above calls and I need to speed things up.

Just a clarifictaion, you said to release the DB handle when I don't need it anymore, do you mean to release it after each result set or after I have finished with the table? (I assume you mean when I have finished with the table)

Thanks for your time
Eban.
0
 
LVL 3

Expert Comment

by:Pegasus100397
Comment Utility
Eban,

Free the handle after you have finished all operations on the table. While opening and closing the handle often can free resources (handlers) on the server, it's usually better performance-wise to keep the handle available until you don't need the table anymore.

My C++ is very rusty (mainly Delphi now) but you seem to be on the right track. Remember that you only need to Alloc, Prepare, SetParams,  Exec and instantiate once (unless the query changes). If you just need to set some different params (but the query remains the same) then just SetParams, Exec and Instantiate. Since the handle has already been Alloc'd and the basic query has not changed, there is no need to re-Alloc & re-Prepare the query.

Good luck :)
Pegasus

0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now