2

So, I know my code for the database connection and reader is functional, because it has worked for me many times before, however, something about this SQL query: enter image description here gives this error message: enter image description here

when this data is inputted: enter image description here This is the database table that I am trying to add the data to: enter image description here

9
  • 2
    The sql of the statement would have been useful... Commented May 4, 2014 at 10:18
  • It is in the pictures and seems to be correct. Commented May 4, 2014 at 10:19
  • Please copy the sql in your question even if it is in the pictures. In the picture we or you could oversee some charactars or whitespaces. Commented May 4, 2014 at 10:21
  • 4
    Not something daft like password is reserved word is it? Commented May 4, 2014 at 10:24
  • 3
    Is according to this. support.microsoft.com/kb/248738 Commented May 4, 2014 at 10:27

1 Answer 1

2

The issue is that you are using "password" as a column name and that's a reserved word in Jet SQL. Either change the name or escape it in SQL code. You do the latter by wrapping it in square brackets [].

Sign up to request clarification or add additional context in comments.

2 Comments

According to this support.microsoft.com/kb/248738 this answer is correct, did you try it?
@juergend, you should probably learn something before you speak. An MDB file is a Jet database, plain and simple. Access is an application that was created to provide easy access to Jet databases. More recently, i.e. with Office 2007, the ACCDB file format was created and an ACCDB file can genuinely be called an Access database but, even then, it still supports the same SQL syntax as Jet, although presumably with some additions. If the OP is using an MDB file then they are using a Jet database and therefore Jet SQL. If they're using an ACCDB file then they're still basically using Jet SQL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.