Solved

BDE specific

Posted on 1997-10-12
4
486 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
[X]
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
  • 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

630 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