Hello,
The main table has an autoinc field. If the user makes a new record,
this field would not get the value generated by the server ONLY if I make a full refresh.
But in this case the customer cannot add bar codes to it (these are child rows and need this field).
In normal use when the customer makes a new record and then adds several bar codes into the child table, after post the keys of these child rows will be null.
To see my problem, click on the link below and have a look at the highlighted field:
http://invitel.hu/csillagzs/autoinc_error.jpg
Thank you very much
			
									
									
						Autoincrement field does not get data from server after post
- 
				Zsolt Csillag
 - Posts: 30
 - Joined: Sun 28 May 2006 16:09
 
- 
				Zsolt Csillag
 - Posts: 30
 - Joined: Sun 28 May 2006 16:09
 
We could not reproduce the problem.
Please send us (evgeniyD*crlab*com) a complete small sample to demonstrate it, including script to create and fill table.
Also supply us following information
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor
			
									
									
						Please send us (evgeniyD*crlab*com) a complete small sample to demonstrate it, including script to create and fill table.
Also supply us following information
- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client. You can see it in Info sheet of TMyConnection Editor
- 
				Zsolt Csillag
 - Posts: 30
 - Joined: Sun 28 May 2006 16:09
 
Hello,
At last I found out what causes the problem though I don't know how to
workaround it.
This is not a simple select in the TMyQuery but a joined one with Distinct.
The Distinct causes this problem (if I don't use distinct the autoinc will refresh):
SELECT DISTINCT(Termek_Azonosito), Termek_Letrehozas_Idobelyeg,
Termek_Megnevezes ,
Termek_BeszerzesiAr,
Termek_Csomagolasi_egyseg,
Termek_MinimumKeszlet,
Termek_Megjegyzes,
Termek_AktualisKeszlet,
Termek_TermekCsop_Azon,
Termek_Afa,
Termek_UtolsoLeltarDatuma,
Termek_Vamtarifa,
Termek_EladasiAr1,
Termek_EladasiAr2,
Termek_EladasiAr3,
Termek_UtolsoBeszallitoKod
FROM
uzlet.termek
LEFT JOIN
uzlet.termek_vonalkod ON uzlet.termek.Termek_Azonosito = uzlet.termek_vonalkod.tv_termek_azon
The sql above joins the Product table (termek) with its bar code table (termek_vonalkod).
Because a product can have many bar codes, I have to use Distinct.
The two tables are joined because the customer wants to search both using product names and bar codes.
Have you got any suggestions?
Thank you
			
									
									
						At last I found out what causes the problem though I don't know how to
workaround it.
This is not a simple select in the TMyQuery but a joined one with Distinct.
The Distinct causes this problem (if I don't use distinct the autoinc will refresh):
SELECT DISTINCT(Termek_Azonosito), Termek_Letrehozas_Idobelyeg,
Termek_Megnevezes ,
Termek_BeszerzesiAr,
Termek_Csomagolasi_egyseg,
Termek_MinimumKeszlet,
Termek_Megjegyzes,
Termek_AktualisKeszlet,
Termek_TermekCsop_Azon,
Termek_Afa,
Termek_UtolsoLeltarDatuma,
Termek_Vamtarifa,
Termek_EladasiAr1,
Termek_EladasiAr2,
Termek_EladasiAr3,
Termek_UtolsoBeszallitoKod
FROM
uzlet.termek
LEFT JOIN
uzlet.termek_vonalkod ON uzlet.termek.Termek_Azonosito = uzlet.termek_vonalkod.tv_termek_azon
The sql above joins the Product table (termek) with its bar code table (termek_vonalkod).
Because a product can have many bar codes, I have to use Distinct.
The two tables are joined because the customer wants to search both using product names and bar codes.
Have you got any suggestions?
Thank you