Solved

SDAC Devart use with Delphi 2007

Posted on 2011-02-22
9
947 Views
Last Modified: 2012-05-11
Hi,

I am not new to programming but I started on a new project using SDAC drivers to access a SQL database.  What I need to know (as I have been unable to find out in all the help and demo programs) is the following:

I wish to access one table within one database on a SQL server to edit 2 fields on a form.  I have the form created and have tried many combinations of TMSConnection,  TMSDataSource, TMSTable and some others.  However, I can not find a way to obtain the correct combination of components to connect to this very simple table.

What components do I need and in which order to effect a simple edit form with a navigation bar at the top?

I did say it was a newbie question!

Best regards,

Bruce
0
Comment
Question by:Bruce-Dev
  • 6
  • 3
9 Comments
 
LVL 19

Expert Comment

by:Thommy
ID: 34950466
Use TMSQuery component

TMSQuery
Uses SQL statements to retrieve data from SQL Server table or tables and supply it to one or more data-aware components through a TDataSource component.
Provides flexible update of data.


SDAC Component List
http://www.devart.com/sdac/components.html#tmsquery
0
 

Author Comment

by:Bruce-Dev
ID: 34950664
I have tried putting TMSQuery on the form and there is no option to connect to a SQL database, select a table or authenticate.  There must be other components to add.  I have read the link before and again now.   All this does is explain what each component is for.

I need to know which component I need to connect to the SQL and which component I need to connect the form components to the SQL source.  Either the documents are missing this basic detail or I have missed some simple step.

When you start from nothing but a form what is required to access data in a simple 2 field table?

Best regards,

Bruce
0
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 34950793
TMSConnection: to connect to your SQL database (controls db connection)
TMSQuery: dataset component to query and update database;
TMSDatasource: interface between TMSQuery and your data-aware controls

SDAC compiled demo
http://www.devart.com/sdac/download.html
http://www.devart.com/sdac/sdacdemo.zip
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 19

Expert Comment

by:Thommy
ID: 34950802
STEP 1: Use TMSConnection to connect to your database
STEP 2: TMSQuery has a connection property, which you must set to your TMSConnection


0
 

Author Comment

by:Bruce-Dev
ID: 34950864
Thommy,

Okay - I have my TMSConnection that can link to my SQL data base.  I have my TMSQuery linked to my TMSConnection and TMSDataSource that is linked to my TMSQuery.  My edit components are linked to my DataSource.  However, where do I specify which table to use?

Best regards,

Bruce
0
 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 500 total points
ID: 34950945
Also download SDAC CHM documentation for further help...

CHM documentation
http://www.devart.com/sdac/download.html
http://www.devart.com/sdac/sdacchm.zip

From the SDAC compiled demo check query.pas to see how it works...

0
 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 500 total points
ID: 34950970
Now you have to provide a SQL statement in property TMSQuery.SQL, which executes when Open method is called...

for example: TMSQuery.SQL:='SELECT * FROM Table1';
0
 
LVL 19

Assisted Solution

by:Thommy
Thommy earned 500 total points
ID: 34951145
Please use help file SDAC.CHM to learn about the SDAC components and their properties and methods...
TMSQuery-Properties.jpg
0
 

Author Closing Comment

by:Bruce-Dev
ID: 34951334
Thommy,

Many thanks for your help.  I can now see the logic once the steps are clear.  It might be me but I could not obtain a clear indication from the help files which modules were required to get started.

Best regards,


Bruce
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LAN or WAN ? 11 89
Can Unique column have more than one Null? 8 53
DBGrid or StringGrid ? 6 88
RESTRequest Parameter 4 30
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

815 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

8 Experts available now in Live!

Get 1:1 Help Now