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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Check Delphi Seattle IOS app without MAC ? 1 97
delphi exception 7 64
Delphi XE10, MySQL Query 4 143
How to debug For loops? 3 49
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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