Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Inserting from databse into textfield

Posted on 2006-07-08
3
Medium Priority
?
192 Views
Last Modified: 2010-04-05
I have a ms access database. I successfully set up a connection. Now, how to insert from database into textfield and vice versa? Thank you.
0
Comment
Question by:Yury Merezhkov
3 Comments
 
LVL 4

Expert Comment

by:LMuadDIb
ID: 17066712

Data browsing and navigation
page1 - http://delphi.about.com/od/database/l/aa032001a.htm
page2 - http://delphi.about.com/od/database/l/aa032001b.htm

A Beginner's Guide to Delphi Database Programming:
http://delphi.about.com/od/database/a/databasecourse.htm

Data modifications:
http://delphi.about.com/od/database/l/aa041701a.htm

http://delphi.about.com/od/database/l/aa050101a.htm

there are alot of ways to do what you ask, but the above links should help to get you started
0
 
LVL 5

Accepted Solution

by:
Scay7 earned 200 total points
ID: 17067657
if adotable1.locate('table name','primary key',[]) then  //first locate the record 'if' exists
begin
edit1.Text := adotable1.FieldValues['db row name']
end else showmessage('Record not found');

if adotable1.locate('table name','primary key',[]) then  //first locate the record 'if' exists
begin
adotable1.Edit;
adotable1.FieldByname('db row name').AsString := edit1.Text;
adotable1.Post;
end else showmessage('Record not found');

the above mentioned is for when the table has been made and when the primary keys are set eg : the db has already been layed out...

Peace Scay7
P.s not a 50 point Q
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 17068634
use TDBEdit, just assign the DataSource and specify the field you want to display
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question