Topic: When I choose something from a TableGrid how is it possible I show the
When I choose something from a TableGrid how is it possible I show the choosen record in a TextBox. ?
exmple
the table has thee records (LastName, Name, Age)
My Visual Database → Script → When I choose something from a TableGrid how is it possible I show the
When I choose something from a TableGrid how is it possible I show the choosen record in a TextBox. ?
exmple
the table has thee records (LastName, Name, Age)
Доброго настроения!
посмотрите это...
Sorry I forgot to write that I need a script.
Hello v_pozidis
You have also this form of script
procedure Form1_TableGrid1_OnCellClick (Sender: string; ACol, ARow: Integer);
Var s : String;
begin
Form1.Panel3.Visible := True;
s := SQLExecute('SELECT Nom from CDThek WHERE id=' + IntToStr(Form1.TableGrid1.dbItemID));
Form1.Label5.Caption := s;
---- and son on if other captions -----
end;
I use it frequently, it is very efficient
JB
Thank you works fine.
and when I have a record which is a Relationship ?
example
The Table A has The Details of the employee but the name came from a different table witch a Relationship to the employee table
v_pozidis
Can you show me the exact structure of your tables?
I have a form with a tableGrid and some EditBoxes. I like whn I select something from the tablegrid to show the selected record in the edit box. I send you my example
Hello v_pozidis
Fisrt thing see on frmShow : yoyr 3 editboxes have fields TableName and FieldName empty.
Second thing : for a better efficiency, you should use a script.
You can slim code by deleting which is not used to your program
See my proposition, in attachment
To read you
JB
Yes it is what I was asking
Thank you so much.
And because I am not familiar with SQL can you please explain me what the script < left outer join > means ?
Hello v-pozidis
Glad I could help you with your project
In SQL, the LEFT JOIN (SQL keyword) command (also called LEFT OUTER JOIN) is a type of join between two tables. This will list all the results of the left table (Table1 ) even if there is no match in the second table (Table2).
Imagine an application that contains users and commands for each user. The database of this application contains a table (left table = table 1) for users and save their purchases in a second table (Table 2). The two tables are linked through the user_id column of the orders table. This allows to associate a command to a user. Here the commun element between the 2 tables is id column.
Of course I'm simplifying a bit.
Best school to understand SQL language (and his power) is to search on the Net with keyword SQL
http://www.w3schools.com/sql/sql_join_left.asp
http://www.sqlcourse.com/intro.html
http://www.tutorialspoint.com/sql/sql-overview.htm
Do not hesitate to also study the SQL code snippets appearing in the FAQ MVD under Script
You have all the chances to find your happiness
If I can help you more
JB
Thank for your quick response and of course foe your help
My Visual Database → Script → When I choose something from a TableGrid how is it possible I show the
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi