Solved

BDE -> MS_SQL refreshing tables

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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--Two Different Totals Even with the Same Concept 6 45
Sql Count with Select Distinct 4 27
Sql Query Datatype 2 19
SQL Server merge records in one table 2 12
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 backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
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.

895 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

19 Experts available now in Live!

Get 1:1 Help Now