Solved

Inserting from databse into textfield

Posted on 2006-07-08
3
182 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now