Solved

BDE specific

Posted on 1997-10-12
4
468 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
ID: 1088986
Adjusted points to 100
0
 
LVL 3

Accepted Solution

by:
Pegasus100397 earned 100 total points
ID: 1088987
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
ID: 1088988
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
ID: 1088989
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
T-SQL: Episode III - Revenge of The Dude 24 53
This query failed in sql 2014 5 31
convert null in sql server 12 34
SQL - Update field defined as Text 6 16
Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

773 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