Solved

BDE -> MS_SQL refreshing tables

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
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.

739 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