Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SDAC Devart use with Delphi 2007

Posted on 2011-02-22
9
Medium Priority
?
1,039 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 2000 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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

When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
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…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

610 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