Solved

Delphi3 & SQL Anywhere

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
indy tidtcpclient threading issue 8 63
Activex get website that activex running on 3 85
Path  to current project in Delphi. 2 72
Best Firemonkey component pack 1 87
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

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

13 Experts available now in Live!

Get 1:1 Help Now