Solved

SDAC Devart use with Delphi 2007

Posted on 2011-02-22
9
953 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

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.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

837 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