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
203 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 104
Making delphi communicate with a c# service 16 122
Error E2158 compiling with Delphi XE10 Seattle 2 124
Tvertscrollbox like a whatsapp layout 5 50
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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

740 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