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

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?
LVL 1
ProbieAsked:
Who is Participating?
 
yk030299Connect With a Mentor Commented:
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
 
rwilson032697Commented:
Listening
0
 
ProbieAuthor Commented:
But, the connection string is to long
I can't compile this code.

do I really need all that in the connection string?

0
 
ProbieAuthor Commented:
I fixed it myself but you helped me get on the right track.

Thanks
0
 
yk030299Commented:
:-) welcome.
I am glad that you won the problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.