Solved

Inserting from databse into textfield

Posted on 2006-07-08
3
186 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:RealSnaD
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 50 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…

756 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