469,275 Members | 1,871 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,275 developers. It's quick & easy.

What's wrong with this?

Oli
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli
Jul 19 '05 #1
6 3915
If you are inserting a number then it should not have quotes around it.
That is a bad practice that Access can get you used to.

Try:

sql="insert into tblNumbers (Number) values (" & i & ")"
"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli

Jul 19 '05 #2
RESPONSE.WRITE SQL
RESPONSE.END

What does that show you?

Is Number a numeric column? If so, don't put the value in '.

Ray at work

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli

Jul 19 '05 #3
p.s. NUmber is a reserved word. You may have to use:
sql = "insert into tblNumbers ([Number]) values......"

Ray at work

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli

Jul 19 '05 #4
Couple of thoughts:
1) If "Number" is numeric, it shouldn't need the 'single quotes' around
the value.
2) "Number" may be a reserved word, so try [square brackets] around the
field name.
3) Try response.write(sql) rather than conn.execute(sql) to see what
statement you're actually executing. This won't solve anything by
itself, but it may show you the problem (i.e. the variable "i" doesn't
hold what you think it does).

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Jul 19 '05 #5
According to www.aspfaq.com this is what's wrong.....
http://support.microsoft.com/?id=248738

Number is a reserved word

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli

Jul 19 '05 #6
Oh yeah, is the column called Number of type Number? If so, then you don't
want those apostrophe's surrounding the value.

"Oli" <ol*@NOSPAMoliwoods.co.uk> wrote in message
news:bq**********@sparta.btinternet.com...
Hi

What's wrong with this?

sql="insert into tblNumbers (Number) values ('" & i & "')"

I get...
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/admin/numberrange.asp, line 14

Many thanks
Oli

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Mike Henley | last post: by
72 posts views Thread by E. Robert Tisdale | last post: by
121 posts views Thread by typingcat | last post: by
28 posts views Thread by Madhur | last post: by
9 posts views Thread by Pyenos | last post: by
3 posts views Thread by Siong.Ong | last post: by
89 posts views Thread by Tubular Technician | last post: by
20 posts views Thread by Daniel.C | last post: by
24 posts views Thread by MU | last post: by
2 posts views Thread by mingke | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.