
June 28th, 2012, 05:23 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 1
Time spent in forums: 12 m 16 sec
Reputation Power: 0
|
|
|
[Delphi6] insert values on a database
hello,
i'm trying to insert some information about marck of a student in a school. But when I insert, using a DBGrid, the database create a new row!!! ok but i need to insert some information to create a relation with other table.
This is my code to create the relation...
Code:
procedure TForm1.Q1BeforePost(DataSet: TDataSet);
begin
ADOCommand1.CommandText:=('INSERT INTO registro'+
'(IdStuFk, IdMatFk, IdDocFk) '+
'VALUES ('+NumIdAlunno+','+numId_Materie+','+numIdDoc+')');
ADOCommand1.Execute;
end;
Ok,.... but when i insert this value into the database, the database create a new row!!!!!
It's not correct!!!! I need to insert my information in the same row where there is the mark!!! HELP ME!!!!
I tried to save the Mark but it is impossilbe, because there are a lot of information and are all the same(for example Rossi have six but Verdi can have the same mark)

|