Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADOTable posting

Status
Not open for further replies.

Squirrel30

Programmer
Aug 13, 2008
3
0
0
SI
Hi

I have this code
MainForm.ADOT1.Insert;
MainForm.ADOT1.FieldByName('ID_VISOBJEKT_ZAHTEV').AsInteger:=MainForm.ADOQ3.FieldByName('ID_VISOBJEKT_ZAHTEV').AsInteger;
if MainForm.ADOT1.State in [dsEdit,dsInsert] then begin
showmessage(MainForm.ADOt1.FieldByName('ID_VISOBJEKT_ZAHTEV').AsString); MainForm.ADOT1.post;
end;
end;
but it doesnt post good .MainForm.ADOT1.FieldByName('ID_VISOBJEKT_ZAHTEV').AsInteger current is 93previous was 92
and it posts 92 istead of 93
why?
 
I feel like there is not too much to go off of at the moment.
Have you tried all of the other forms of error trapping.
By this I mean, you used a ShowMessage to verify that the field from the ADOQ3 is what you expect it to be.
Can you please clarify what you mean by previous and current? Did you just change a value in the database from 92 to 93, and then you are using the query to pull that number?

I am actually not sure if it matters, but when you go to ShowMessage try pulling the value as an Integer if it is indeed an integer, and then using [blue]IntToStr()[/blue] on the value. Based on what the database is stored in (mysql, access, oracle, etc) I believe that pulling an integer value as a string could result in what you see not being what is stored. Then again I could be way off on that one. I am not as experienced as some of the others who frequent here.

~
Chuck Norris is the reason Waldo is hiding.
 
Thaks Opeo,
I resolve it.
Actualy my colegue had put before post event thats why the value was changeing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top