Solved

Inserting from databse into textfield

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 240
How to convert memory stream to PDF file 6 119
How to create virtual printer while installing my application 5 61
DBCtrlGrid, Delphi, Scroll 7 26
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

831 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