How can I use SQL codes in delphy7?

5 pts.
Tags:
Microsoft SQL Server 2000
SQL 2000
SQL Server administration
I am going to use the sql code below in a query in delphy7 SELECT     left(edit1.text, 5)+'0 ' FROM        edit.text2

Software/Hardware used:
sql2000 AND delphy7

Answer Wiki

Thanks. We'll let you know when a new response is added.

The complete SQL command doesn’t make any sense unless edit1 contains a field name from the database and edit conatins the table name.

You definitely can’t use “left(edit1.text, 5)” and “edit.text” as part of the SQL command as the database doesn’t know your form’s controls. In any case, you should concatenate the contents of the controls to construct the SQL command as you are doing to add the ‘0’, but it is a better practice to parameterize the commands instead of constructing them dynamically.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following