Go Premium for a chance to win a PS4. Enter to Win

x
?
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
Medium Priority
?
209 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 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

916 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