Setting TQuery SQL Statement

CK1820 
Created at Aug 25, 2007 00:26:36 
6,405   0   0   0  
This source code sets the SQL String in Query1. As it fits on one line we just use SQL[0].

The
SQL statement finds all the fields from the Article table where the
user_id field is equal to a varaible Text value dbtUser.Text.

A better way would be to use Parameters in the Query.
      
      
Query1.SQL[0] := 'select * from article where user_id = ' + dbtUser.Text + '';

Query1.Active := True;


 

Tags: Delphi SQL TQuery Share on Facebook Share on X

▶ NEXT
How can I modify aliases programmatically ?
  Comments 0
Login for comment
SIMILAR POSTS

How can I modify aliases programmatically ? (created at Aug 25, 2007)

Get The Drive Type (created at Aug 25, 2007)

How To Get Windows And System Directory (created at Aug 25, 2007)

How To Get Volume Name (created at Aug 25, 2007)

How To Register Own File Types (created at Aug 25, 2007)

How To Force The Correct Decimal Separator (created at Aug 25, 2007)

How To Change Screen Resolution (created at Aug 25, 2007)

How To Check If A Soundcard Is Installed (created at Aug 25, 2007)

How To Open Url In Default Webbrowser (created at Aug 25, 2007)

How To Send An E-mail By Code (created at Aug 25, 2007)

How can I hide the caption bar on a form? (created at Aug 25, 2007)

How To Make A Gradient Filled Form (created at Aug 25, 2007)

How To Get The Windows Language (created at Aug 25, 2007)

How To Change The Desktop Wallpaper (created at Aug 25, 2007)

How To Get The Windows OS Version (created at Aug 25, 2007)

How To Change The System Time (created at Aug 25, 2007)

How To Find Out Total And Available Memory (created at Aug 25, 2007)

How To Get Windows Uptime (created at Aug 25, 2007)

How To Make Rounded Windows (created at Aug 25, 2007)

How To Pass The Focus To The Next/prior Control (created at Aug 25, 2007)

How To Make An Animated Application Icon (created at Aug 25, 2007)

How To Show The Print Dialog And Print Text Files (created at Aug 25, 2007)

How Do I Remove The Application Icon From The Taskbar? (created at Aug 25, 2007)

How to draw Transparent Text on bitmap (created at Sep 01, 2007)

Browse for Computers, Folders, Files and Printers (created at Sep 10, 2007)

Checking If File Is In Use (created at Sep 10, 2007)

Convert a mapped drive to a full UNC path (created at Sep 10, 2007)

Does my CD-ROM drive contain an audio CD? (created at Sep 10, 2007)

Delete files with the ability to UNDO (created at Sep 10, 2007)

Delete folders recursively (created at Sep 10, 2007)

OTHER POSTS IN THE SAME CATEGORY

How To Get The Windows OS Version (created at Aug 25, 2007)

How To Change The Desktop Wallpaper (created at Aug 25, 2007)

How To Get The Windows Language (created at Aug 25, 2007)

How To Make A Gradient Filled Form (created at Aug 25, 2007)

How can I hide the caption bar on a form? (created at Aug 25, 2007)

How To Send An E-mail By Code (created at Aug 25, 2007)

How To Open Url In Default Webbrowser (created at Aug 25, 2007)

How To Check If A Soundcard Is Installed (created at Aug 25, 2007)

How To Change Screen Resolution (created at Aug 25, 2007)

How To Force The Correct Decimal Separator (created at Aug 25, 2007)

How To Register Own File Types (created at Aug 25, 2007)

How To Get Volume Name (created at Aug 25, 2007)

How To Get Windows And System Directory (created at Aug 25, 2007)

Get The Drive Type (created at Aug 25, 2007)

How can I modify aliases programmatically ? (created at Aug 25, 2007)

UPDATES

Creating a Pinterest-Style Card Layout with Bootstrap and Masonry (created at Apr 24, 2024)

Mastering Excel Data Importation in PHP (updated at Apr 24, 2024)

JSON format control in PHP (updated at Apr 24, 2024)

Equal Height Blocks in Bootstrap with JavaScript (created at Apr 22, 2024)

How to convert integer to text string ? (updated at Apr 22, 2024)

Checking similarity between two strings in PHP (updated at Apr 21, 2024)

Create Blob Image in HTML based on the given Text, Width and Height in the Center of the Image without saving file (updated at Apr 21, 2024)

How do I determine the client IP type (IPv4/IPv6) in PHP (updated at Apr 16, 2024)

How do I determine the client IP type in Python - IPv4 or IPv6 (updated at Apr 13, 2024)

Getting Started with PyTorch: A Beginner's Guide to Building Your First Neural Network (updated at Apr 09, 2024)

Predicting Buyer Preferences with PyTorch: A Deep Learning Approach (updated at Apr 09, 2024)

Forecasting the Weather with PyTorch: A Beginner's Guide to Temperature Prediction (created at Apr 09, 2024)

PyTorch example to Forcast Stock Price based on 10 days Dataset (created at Apr 09, 2024)

Mastering Model Persistence: Saving and Loading Trained Machine Learning Models in Python (created at Apr 08, 2024)

Harnessing the Power of Random Forest Algorithm in Python (created at Apr 08, 2024)

Understanding and Implementing K-Nearest Neighbors (KNN) Algorithm in Python (created at Apr 08, 2024)

Forecasting with Linear Regression and KNN Regression in Python (updated at Apr 07, 2024)

What is 302 Found Redirection in HTTP 1.1? (created at Apr 04, 2024)

Mastering Random Forest Regression: A Comprehensive Guide with Python Examples (updated at Apr 01, 2024)

Python Implementation of Linear Regression (updated at Apr 01, 2024)

Mastering Supervised Machine Learning with Python: A Comprehensive Guide (created at Apr 01, 2024)

Mastering AI: A Beginner's Guide to Python Programming and Beyond (created at Apr 01, 2024)

How do I create animated background for Google Meet? (updated at Mar 28, 2024)

Building a Simple DNS Server in Delphi with TTL Support (created at Mar 16, 2024)

How to force cookies, disable php sessid in URL ? (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in PHP: Handling A, AAAA, CNAME, and TXT Records (updated at Mar 16, 2024)

Implementing a Versatile DNS Server in Python: Handling A, AAAA, CNAME, and TXT Records (created at Mar 16, 2024)

Building a Basic DNS Server in PHP/Python: A Beginner's Guide (updated at Mar 15, 2024)

Dynamic DNS Made Easy: Building a Python-Based Solution (created at Mar 15, 2024)

Exploring the Depths of Data Transfer: sendfile vs. kTLS (created at Mar 15, 2024)