If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Syntax Error?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-16-04, 19:14
jmiller321 jmiller321 is offline
Registered User
 
Join Date: Jun 2004
Posts: 11
Exclamation Syntax Error?

Help!I run this VBA code and it says that i have a syntax error and that i am missing an operand. ANy ideas?

SQL = ("UPDATE [Product]" & _
" SET [Product Name] = Forms![-- DM: Product].[Product Name]" & _
"[Product Type] = Forms![-- DM: Product].[ProductTypeCombo]" & _
"[Program Type] = Forms![-- DM: Product].[ProgramTypeCombo]" & _
"[Basic Price] = Forms![-- DM: Product].[Basic]" & _
"[Team Price] =Forms![-- DM: Product].[Team]" & _
"[Early Bird Price] = Forms![-- DM: Product].[Early Bird]" & _
"[Other Price] = Forms![-- DM: Product].[Other]" & _
"[Retail Price] = Forms![-- DM: Product].[Retail]" & _
"[Production Date] = Forms![-- DM: Product].[Production Date]" & _
"[Production End Date] = Forms![-- DM: Product].[Production End Date]" & _
"[Date Entered] = Forms![-- DM: Product].[Date Entered]" & _
"[Date Last Modified] = Forms![-- DM: Product].[Date Last Modified]" & _
" WHERE [Product Name] = Forms![-- DM: Product].[Product Name]")

thanks!
Reply With Quote
  #2 (permalink)  
Old 06-28-04, 14:40
Wolverchenus Wolverchenus is offline
Registered User
 
Join Date: Mar 2004
Posts: 34
The best way I know to debug such a long sentence is just to delete parts of it until it works then work your way back on writing those lines..
If at the most minimal sentence you still have a problem then you probably missed some meaningful char..
Reply With Quote
  #3 (permalink)  
Old 06-28-04, 22:48
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
Here's what I do:

(1) Build the SQL-string up one statement at a time. You don't need to concatenate a godawful string together. The computer don't care; people do!

(2) Put line-numbers in it. When an exception occurs, the error-line shows you the most recent line-number encountered. You're not using them in a goto statement so you don't need to label every one, but now you can have error messages that tell you very closely where the error is.
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On