codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Syntax error in INSERT INTO statement  Archive Import (Nir) at 13:16 on Wednesday, August 27, 2003
 

Hey Guys, I`m having that agonizing error when trying to add a new record to the DB (vb.net, db = access). I used both the generated Insert Command and made a new command - I get that exception in both cases.
Here`s the code of the auto-generated insert command:
---------
INSERT INTO Appointments(AppointmentID, BarberName, CustomerName, Day, Duration, Haircut, Hour, Minute, Month, SpecificBarber) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
-------------

When I created my own command, instead of the question marks, I the actual variables needed (with & before and after..).

When debugging - I see the new row that`s added to the dataset (just before I try to update the dataset into the DB) - has all the correct values.

Please help me.

  Re: Syntax error in INSERT INTO statement  Archive Import (Nir) at 13:25 on Wednesday, August 27, 2003
 

One thing I forgot to add: AppointmentID is an auto-incremented number.
I add a number in the row I`m trying to add.
(if this has any influence)...

  Re: Syntax error in INSERT INTO statement  Archive Import (Nir) at 13:33 on Wednesday, August 27, 2003
 

uh ooops
Sorry, just checked to be sure. it seems AppointmentID is NOT an auto number. it`s a regular int. Still getting the error though

  Re: Syntax error in INSERT INTO statement  Archive Import (Nir) at 09:16 on Thursday, August 28, 2003
 

Problem solved
It appears Day, Month, Hour, Minute etc are reserved words in Access, so I couldnt update those fields...








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Re: Security - Code verify
•  Job @ EarlySail
•  Job @ EarlySail (perl)
•  IPC problem
•  Re: import contacts of msn/yahoo
•  Cookies and Threads C++
•  right justify a background in a table?
•  Help with Loop (C++/MFC)
•  Help with Loop (C++/MFC)


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007