Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

BDE specific

Posted on 1997-10-12
4
473 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
LTrim & Double Space Correction 5 39
Powershell v3 - SQLCMD 3 26
Dynamic SQL select query 4 36
Parse this column 6 23
Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
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…

789 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