home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

INSERT INTO syntax error in MS Access

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 1530
Discussions: 200,952, Posts: 2,379,478, Members: 246,322
Old May 21st, 2002, 11:05 PM   Digg it!   #1 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
INSERT INTO syntax error in MS Access

Not a big fan of access, anyway...

Have the following table, named table1

col1 named string1 text datatype
col2 named integer1 number (long integer) datatype

Try the following SQL statement:

INSERT INTO table1 (string1, integer1) VALUES ("access sucks", 45);

Get "syntax error in INSERT INTO statement" when I attempt to run in Access (query design mode) and through java client, so I doubt the jdbcodbc driver issue.

Any ideas, or does Access just blow?
qball is offline   Reply With Quote
Old May 21st, 2002, 11:50 PM     #2 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
hhmm, well, you probably tried it, but first thing to mind is to try using single quotes instead of double quotes... next I'd check to see if the string being entered isn't too long for the field in the db. ...surely you have double-checked the spelling of field names??

anyways, g'luck... I'll try to check back later and see how it goes...
^hyd^ is offline   Reply With Quote
Old May 22nd, 2002, 01:53 AM     #3 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
OMG!!!

ok, re-read your post, and recreated exact same, threw your query in via sql-view in the query editor. didn't work... "syntax error in Insert..." blah blah... and it highlighted 'integer1'.

so, changed everything to 'finteger1' and no prob!! back to 'integer1', error... then tried '_integer1', worked fine again... it appears that you can't name a field 'integer1'... go figure...

anyways, g'nite...
^hyd^ is offline   Reply With Quote
Old May 22nd, 2002, 02:19 AM     #4 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
omg back at you? lol

good try. and helpful,thanks but,

[bigbut]
I'm, basically an access idiot, and can get to Java error.
tired and will try "better", later
[/bigbut]

thanks. mo later...
qball is offline   Reply With Quote
Old May 22nd, 2002, 06:30 PM     #5 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
^hyd^,

It was the name of the fields, that caused the problem, though the original names fit the naming conventions, from access help file:

Quote:
Can be up to 64 characters long.

Can include any combination of letters, numbers, spaces, and special characters except a period (.), an exclamation point (!), an accent grave (`), and brackets ([ ]).

Can't begin with leading spaces.

Can't include control characters (ASCII values 0 through 31).
...

When you name a field, control, or object, it's a good idea to make sure the name doesn't duplicate the name of a property or other element used by Microsoft Access; otherwise, your database can produce unexpected behavior in some circumstances.

A good example of why Access IS NOT a real DB.
qball is offline   Reply With Quote
Old May 22nd, 2002, 09:53 PM     #6 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,386
lol qball, I agree.. I hate Access
Good call hyd, I never would of that of that
__________________
Helicopters don't fly; they vibrate so much and make so much noise that the earth rejects them.
vass0922 is offline   Reply With Quote
Old May 22nd, 2002, 10:47 PM     #7 (permalink)
Senior Member
 
Rhino's Avatar
 
Join Date: Oct 2001
Posts: 552
Dude, you mean Qball actually needs help sometimes? I thought he knew it all. LOL

Anyways, I would try changing the query type in Acess to an update query if you haven't changed it. It will be on Select query by default, although you think it would be smart enough to read the SQL and change the Query.
__________________
It's like that, and it's like this....
Rhino is offline   Reply With Quote
Old May 23rd, 2002, 01:08 AM     #8 (permalink)
Banned
 
qball's Avatar
 
Join Date: Oct 2001
Posts: 447
Quote:
Dude, you mean Qball actually needs help sometimes?...

qball, needs help, all the time! (email money),lol.

btw, am I, both the subject and participle of that sentence, nevermind.

Anyway, the INSERT INTO syntax using reserved words STARTING column names in Access, is my bad, thanks already given.

What I was doing was a simple benchmark test. Something I've done before, fairly easily...

Ok, connect to DB.
Insert 100000 rows of a variety of datatypes. (hundred thou, 100k, iffin don't wanna count zero)
Report results.

Access CAN do 10000 in 38 secs, pathetic...

That's 10 thou.
qball is offline   Reply With Quote
Old May 23rd, 2002, 01:37 AM     #9 (permalink)
Senior Member
 
Rhino's Avatar
 
Join Date: Oct 2001
Posts: 552
What pc setup are you using? That could have something to do with it. I may give it a try.
Rhino is offline   Reply With Quote
Old May 23rd, 2002, 05:56 AM     #10 (permalink)
Not Really a Member
 
Join Date: Oct 2001
Posts: 25,386
Can you give us the results against maybe MySQL and SQL Server? Maybe even Oracle?

Well in Access's (coughcough bleh chokechoke) defense, its not meant to be a scalable database, just something for fairly small databases with not to many users
That also depends on what kind of indexes you have on the tables, too many and it'll slow things down
vass0922 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2943)
The disrespect of Obama by Russian .. (41)
Making Health Care Worse (178)
Wireless Televisions. (12)
CPU fan stops spinning randomly (9)
Regular Build (11)
windows 7 problem (7)
Is the PSU I received dead? (12)
radeon x850xt platinum & shader.. (6)
Print spooler problem (15)
HIS HD5770 graphic card question (15)
windows vista security holes (10)
Install XP pro and a Vista laptop ?.. (11)
Foreign voltage (10)
Recent Discussions
tv not turn on-makes clicking sound (2)
SELLING FRESH,CVV,LOGINS,DUMPS,TRACKS.. (0)
CPU fan stops spinning randomly (9)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Modern Warfare 2: Who Bought It? (63)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Laptop with wireless problem. (3)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
windows vista security holes (10)
Point and Shoot Camera Suggestions. (4)
Multiple Restarts Required at Boot (2)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)
How to convert MP3's (4)
Wireless Televisions. (12)
Hp Artist Edition + Matching Bag (0)
Asus P4G8X Mobo (6)
Xbox 360 GTA: SA disk error (1)
Is the PSU I received dead? (12)


All times are GMT -4. The time now is 05:01 AM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28