Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

strings using SQL

Status
Not open for further replies.

johndelphi

IS-IT--Management
Jul 1, 2003
10
0
0
ZA
i have this code:
q.SQL.Add('SELECT * FROM GroupItem WHERE ID = "' + userID + '"');
where userID is obviously a string.
I get an error with it and i think its the whole string within a string problem.
how do i typecast the string for the SQL statement to read the userID.
 
Not all DBMS accept the double quote as a string delimiter. Try this:
[blue]
Code:
q.SQL.Add('SELECT * FROM GroupItem WHERE ID = ' + QuotedStr(userID));
[/color]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top