Solved

Delphi3 & SQL Anywhere

Posted on 1997-11-10
3
268 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
  • 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

17 Experts available now in Live!

Get 1:1 Help Now