Solved

Need example on how to reterive data from a MS SQL server using Delphi 5's ADO component

Posted on 2000-03-06
5
202 Views
Last Modified: 2013-11-23
Can anyone give me an easy example on how to reterive a field <field> from a database <database> on a SQL server with name <name> using the ADO components shipped with Delphi 5 Enterprise?
0
Comment
Question by:Probie
  • 2
  • 2
5 Comments
 
LVL 1

Accepted Solution

by:
yk030299 earned 50 total points
ID: 2589815
use TADOQuery

set
with ADOQuery1 do begin
Connection:='
Provider=SQLOLEDB.1;Password=superpass;Persist Security Info=True;User ID=sa;Initial Catalog=dbTest;Data Source=DB_NT;Locale Identifier=1028;Connect Timeout=15;Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Application Name=Delphi_ADO;Workstation ID=WorkSTAT_ID';
SQL.text:='select *from table1';
Open;
Str1:=FieldByName('FieldName1').AsString;
end;

I hope it helps.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2589846
Listening
0
 
LVL 1

Author Comment

by:Probie
ID: 2591707
But, the connection string is to long
I can't compile this code.

do I really need all that in the connection string?

0
 
LVL 1

Author Comment

by:Probie
ID: 2591792
I fixed it myself but you helped me get on the right track.

Thanks
0
 
LVL 1

Expert Comment

by:yk030299
ID: 2594144
:-) welcome.
I am glad that you won the problem.
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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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