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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Save pdf file to other location 3 72
JSON on ISAPI REST Server using Delphi 2 210
delphi custom sort exception 6 111
Working with hours 3 31
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This video discusses moving either the default database or any database to a new volume.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now