0

What is wrong with this SQL-syntax?

INSERT INTO chatt (user, msg, ip) VALUES('testUser', 'testMsg', '81.235.154.103')

The server is running some IIS with an unknown SQL version, but the files has to be in access 2000-format. The fields i've got are id, user, msg, ip, datum. 1st one is a counter, last one is a date/time and the rest are text fields. How do i insert into those three fields?

1
  • 6
    What is the error it gives? Commented Feb 14, 2011 at 14:14

2 Answers 2

4

user may be a reserved word. Try putting it in brackets [user]

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

Comments

2

Without the actual error message we can't really tell, but two obvious things jump out:

  • user is a reserved word; enclose it in square braces: [user]
  • Your datum field may be not null, which means you need to provide a value for it in your statement.

Comments

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.