473,503 Members | 9,887 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4164
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2354
by: Mike Henley | last post by:
I first came across rebol a while ago; it seemed interesting but then i was put off by its proprietary nature, although the core of the language is a free download. Recently however, i can't...
72
5734
by: E. Robert Tisdale | last post by:
What makes a good C/C++ programmer? Would you be surprised if I told you that it has almost nothing to do with your knowledge of C or C++? There isn't much difference in productivity, for...
121
9907
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
28
3234
by: Madhur | last post by:
Hello what about this nice way to open a file in single line rather than using if and else. #include<stdio.h> void main() { FILE *nd; clrscr();...
9
2110
by: Pyenos | last post by:
import cPickle, shelve could someone tell me what things are wrong with my code? class progress: PROGRESS_TABLE_ACTIONS= DEFAULT_PROGRESS_DATA_FILE="progress_data" PROGRESS_OUTCOMES=
3
2135
by: Siong.Ong | last post by:
Dear all, my PHP aims to update a MySQL database by selecting record one by one and modify then save. Here are my PHP, but I found that it doesnt work as it supposed to be, for example, when...
89
5649
by: Tubular Technician | last post by:
Hello, World! Reading this group for some time I came to the conclusion that people here are split into several fractions regarding size_t, including, but not limited to, * size_t is the...
20
2795
by: Daniel.C | last post by:
Hello. I just copied this code from my book with no modification : #include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0;
24
3066
by: MU | last post by:
Hello I have some code that sets a dropdownlist control with a parameter from the querystring. However, when the querystring is empty, I get an error. Here is my code: Protected Sub...
2
2213
by: mingke | last post by:
Hi... So I have problem with my if condition..I don't know what's wrong but it keeps resulting the wrong answer.... So here's the part of my code I have problem with: for (i=0; i<size2;...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
403
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.