Solved

Delphi3 & SQL Anywhere

Posted on 1997-11-10
3
288 Views
Last Modified: 2010-04-04
These questions relate to Delphi3 with SQL Anywhere.
1. Using tables with autoIncrement fields. After insert/post the value assigned to the autoIncrement field is not available. To get it I need to do a last with the field as the index. This is not good.
The value is available after the post when using Paradox and Access tables.

2. When using a TQuery and a DBGrid, new records do not appear in the grid unless I refresh the query by close/open. If I substitute a TTable it works fine.

I must be missing something in the SQL Anywhere/odbc options but just what escapes me.
0
Comment
Question by:wilkinsbryan
[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
3 Comments
 
LVL 1

Accepted Solution

by:
anilms earned 50 total points
ID: 1349863
But that is the way an RDBMS like Sybase/MS SQL Server/Oracle works. It is the case not ony with Delphi, it is the same with VB also.

1. Paradox gives you the data updated immediately because you are using a TTable.

2. If you are using TQuery and DBGrid with Paradox/DBF, then also you have to do a refresh by close/open to update the view. Otherwise it will not reflect the latest status.

You are not missing anything anywhere, it is the way it works with RDBMS.
0
 

Author Comment

by:wilkinsbryan
ID: 1349864
Thank you for that.
I was not specific enough in my second question. The records which do not appear are the ones added by the user. They are added to the DBGrid and when the grid is scrolled the record is no longer there. This does not seem to good.
0
 

Author Comment

by:wilkinsbryan
ID: 1349865
Further info, FYI
I got a response from the Delphi news group which suggested that I use 'select @@identity' to get the autoIncrement number. Works fine.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 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