SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 one line error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mjimenezh
Yak Posting Veteran

Mexico
63 Posts

Posted - 03/07/2014 :  15:23:51  Show Profile  Reply with Quote
Hi, I'm very bad because I cannot found the error in one line of code, I receive an syntaxis error near "prijslst" field, this code is char type, this is my code please help.

Thanks in advance

CON3.Execute "update staffl set prijs83=" & MSFlexGrid1.TextMatrix(RENGLON, 9) & "WHERE artcode=" & "'" & MSFlexGrid1.TextMatrix(RENGLON, 1) & "'" & "prijslijst='SALESPRICE'"

James K
Flowing Fount of Yak Knowledge

3744 Posts

Posted - 03/07/2014 :  15:30:13  Show Profile  Reply with Quote
quote:
Originally posted by mjimenezh

Hi, I'm very bad because I cannot found the error in one line of code, I receive an syntaxis error near "prijslst" field, this code is char type, this is my code please help.

Thanks in advance

CON3.Execute "update staffl set prijs83=" & MSFlexGrid1.TextMatrix(RENGLON, 9) & "WHERE artcode=" & "'" & MSFlexGrid1.TextMatrix(RENGLON, 1) & "'" & "prijslijst='SALESPRICE'"



Make the following changes:
1. Insert a space before WHERE
2. insert a " AND " before prijslijst
CON3.Execute 
"update staffl set prijs83=" & MSFlexGrid1.TextMatrix(RENGLON, 9) 
& " WHERE artcode=" & "'" & MSFlexGrid1.TextMatrix(RENGLON, 1) 
& "'" & " AND prijslijst='SALESPRICE'"
Go to Top of Page

mjimenezh
Yak Posting Veteran

Mexico
63 Posts

Posted - 03/07/2014 :  15:35:45  Show Profile  Reply with Quote
Thanks for your help, It works, I was very saturated and I didn't see the error.


Best regards...
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000