Solved

Delphi3 & SQL Anywhere

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
add combobox item based on numbers 9 141
Magic Software info 18 130
Convert GUI app into console app for Win32 Env 5 99
tvirtualstringtree freeze when load too manny images 10 60
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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