syntax error INsert INTO statement

suju_26pro

Well-known member
Joined
May 4, 2011
Messages
48
Programming Experience
Beginner
hello frnd ...just can't get out of this error..plz help me out..
i want to input the source text to my database ..every connection i had make works fine except the update line ...i given a image for better understanding wht i really want plz help me out ..i hv to submit my academic project on Friday ..still a long way to go plz help me .......:confused:
actually the flow go in this way..the user will browse for specific folder ..that input folder i want to display on my database...plzz help me totally depeng on u guyzzz:confused:
 

Attachments

  • error.jpg
    error.jpg
    125.1 KB · Views: 44
  • Untitled.jpg
    Untitled.jpg
    292.5 KB · Views: 36
  • database.jpg
    database.jpg
    204.9 KB · Views: 40
The reason that this error occurs is that you have a wildcard in your SELECT statement and a column name that is a reserved word, i.e. Date. When the command builder builds the commands, it doesn't escape and identifiers so any resreved words or special characters cause a syntax error. Your choices, in my order of preference, are:

1. Change your column name to something that is not a reserved word and does not contain special characters. You always should avoid such names if possible.
2. Set the QuotePrefix and QuoteSuffix propertoes of your command builder so all identifiers are escaped. For Access, the values would be "[" and "]" respectively.
3. Don't use a wildcard in your query. Write out the full column list, in which case you must escape those that need it yourself. The command builder will follow your lead.
 
Back
Top