PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Windev 12 - Table based on query
Windev 12 - Table based on query
Débuté par ICI, 12 sep. 2008 01:03 - 3 réponses
Posté le 12 septembre 2008 - 01:03
Regards !
I use Blank form and then put Table on the form, then create query with parameters
and table is created. I change parameters MySource.Param1 = gnFirmeID,...
and data are queried and displayed, but
1. Open(Form): IF Firme..NewRecord (always back True)
2. TableDelete can not delete record into table (.FIC file) and also into Query
3. TableDisplay("", taCurrentRecord) not functioning, always on top,...
Is the any way to use Query's for Table and Forms, same like Table based on direct file access.
Posté le 15 septembre 2008 - 01:07
I like to create an external query and then create a table form based on the query. This puts the query code in the window processes and makes it easier to manipulate. To delete or update a record in the query and let it reflect in the source table, use hModifyFile ie.
hExecuteQuery(MyQuery,hQueryDefault+hModifyFile)
Posté le 15 septembre 2008 - 01:11
issah,
Thank you for your answer, but I think I dont understand you in complete.
maybe, 'couse I'm pretty new in WinDev and also with queries.
I'm do the same, but only code I can see is on the Initialization of Table:
MySource.Param1 = ""
MySource.Param2 = ""
and I can replace "" with my variables, but I dont know where to put code
HExecuteQuery(...),
Can you help me with little sample zip file or with screenShots.
Posté le 15 septembre 2008 - 01:12
It seems that maybe you created a blank window and then placed a table control on it. In doing so you chose the "define query now" option which created an embedded query for the table. This embedded query is known only within the table control and as such is often difficult to control as its interface is hidden by the table. As such the HExecuteQuery() is handled by the table automatically but it may not be what you want.
My preferred solution is to manually create the query and then using the 11-compatible RAD create, a window based on a table. This puts the query code in the initialization process of the window and makes it easier to control the query as well as the table. Windev queries are great (esp. client server) but have less functionality than direct file access so how they are used is important so you don't find yourself in a tight corner. I very rarely use embedded queries. You can use embedded queries for record selection tables and combo boxes but not for data entry.
issah