Solved

SDAC Devart use with Delphi 2007

Posted on 2011-02-22
9
979 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Turn Insights Into Action

You’ve already invested in ITSM tools, chat applications, automation utilities, and more. Fortify these solutions with intelligent communications so you can drive business processes forward.

With xMatters, you'll never miss a beat.

 
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

717 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