Solved

BDE -> MS_SQL refreshing tables

Posted on 1997-10-09
2
497 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

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…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

832 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