Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:52 AM
Oli
Guest
 
Posts: n/a
Default What's wrong with this?

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


  #2  
Old July 19th, 2005, 09:52 AM
Tony Archer
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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
>
>[/color]


  #3  
Old July 19th, 2005, 09:52 AM
Ray at
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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
>
>[/color]


  #4  
Old July 19th, 2005, 09:52 AM
Ray at
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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

Ray at work

"Oli" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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
>
>[/color]


  #5  
Old July 19th, 2005, 09:52 AM
Kris Eiben
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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[/color]


  #6  
Old July 19th, 2005, 09:52 AM
TomB
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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

Number is a reserved word

"Oli" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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
>
>[/color]


  #7  
Old July 19th, 2005, 09:52 AM
TomB
Guest
 
Posts: n/a
Default Re: What's wrong with this?

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

"Oli" <oli@NOSPAMoliwoods.co.uk> wrote in message
news:bqg7ai$1qr$1@sparta.btinternet.com...[color=blue]
> 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
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles