Solved

BDE -> MS_SQL refreshing tables

Posted on 1997-10-09
2
493 Views
Last Modified: 2009-12-16
Hello,
I am using
 Borland C++ -> BDE -> SQL links -> MS_SQL

When opeing a table using DbiOpenTable, should I then leave the table open and keep doing operations. If I do this and the table is changed the changes are not updated on my client. They are updated when I close the table and reopen it though.

What I want to do is be able to update information and add new records, then next time I do a request the updated information is there.

I have just started out using this setup and I hope the poblem is obvious. Any suggestion would me much appreciated.

Thanks for your time.
Eban.
0
Comment
Question by:eban
2 Comments
 
LVL 9

Accepted Solution

by:
cymbolic earned 50 total points
ID: 1088978
I work primarily in VB with SQL server, but it is typical behaviour for an SQL resultset not to show added records.  This is because when you initially get your result set, you are working with a copy of it only on your client, and until you get another copy, you only have what you started with.  Inserting new rows will not insert them also into the rows you have on your client machine.  You generally have to reselect(requery) to get the changed information.  In VB you can have what is called a dynaset cursor keyset.  In this instance, if something is changed on the server that you have in your resultset, you do get the changes, but that is because the server sends down a keyset, and doesn't actually "Fetch" the data you asked for until you position on that row.  You should look in your language for ways to set up dynamic cursors using keysets, or for a refresh method to requery your server.  Gnerally, in our environment, using table based  methods is more limiting than using queries and resultsets (or recordsets).  This is because we get more options to control the type of access and recordset returned, and can specify read only sets to improve performance and reduce locking in multiuser situations.  Check of you have alternatives to the tabel method for accessing.  You may have some wiggle room there.

Also, you need to know that SQL server will escalate your page locks to complete table locks under some selection criteria, more likely if you are using table methods.  This will cause you multiuser problems.
0
 

Author Comment

by:eban
ID: 1088979
I need a more 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, or is there another way?

Thanks Eban.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

757 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

27 Experts available now in Live!

Get 1:1 Help Now