473,396 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem with insert into

2
Hi,

I have the following code for inputting the two variables userid and password from the form to my ms access db:

Cn.Execute "INSERT INTO Users (uid,password) Values " & _
"('" & userid & "', '" & pwd & "')"

But it gives the following error:

Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/loginms/Register.asp, line 43


Can anyone help with this please?

Thanks very much in advance.
Oct 1 '06 #1
6 3260
sashi
1,754 Expert 1GB
Hi there,

Kindly refer to below modified SQL statement, take care my fren.. :)

Expand|Select|Wrap|Line Numbers
  1.   Cn.Execute "INSERT INTO Users (uid,password) Values " & _
  2.   "('" & userid & "','" & pwd & "')"
  3.  
Oct 5 '06 #2
koner
2
Hi there,

Kindly refer to below modified SQL statement, take care my fren.. :)

Expand|Select|Wrap|Line Numbers
  1.   Cn.Execute "INSERT INTO Users (uid,password) Values " & _
  2.   "('" & userid & "','" & pwd & "')"
  3.  

Hi again,

Thank you very much for your reply. However, there seems to be a problem with your code as well (it again gives the same syntax error).

Also, to be honest, I could not see a difference with the code I wrote and your version. Am I missing something?

Thank you very much again.
Oct 13 '06 #3
sashi
1,754 Expert 1GB
Hi there,

Quotation marks ( "', ‘ ’, “ ” ) are important, check out. Good luck & Take care.
Oct 16 '06 #4
I had this same problem using a MS Access Database table. I just left out the column names in my statement and the syntax error went away.

Try this, Cn.Execute "INSERT INTO Users Values " & _
"('" & userid & "', '" & pwd & "')"

My belief right now is that MS Access doesn't like it when you define all of the columns in a table for inserting. I haven't tried yet, but I think that if you had three columns, and defined two in your statement, then the command would work, but if you have two columns, and you define both in your statement, MS Access generates the syntax error you are experiencing.
Feb 21 '07 #5
Hi there,

The problem you had was probably caused by Access having some fieldnames as reserved keywords. Try putting [brackets] around your fieldnames and your problem will probably go away, while still using correct transact-sql statements.

Cheers,
Arno
Feb 21 '07 #6
Yep. That did it. Brackets fixed it. Thanks!
Feb 22 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
5
by: Juho Saarikko | last post by:
I made a Python script which takes Usenet message bodies from a database, decodes uuencoded contents and inserts them as Large Object into a PostGreSQL database. However, it appears that the to...
0
by: Dean A. Hoover | last post by:
I am doing a contract job for a client with some existing messy data. I am trying to find a solution to a problem of many-to-many mappings between two tables in a database. See below for my...
2
by: Gunnar Vøyenli | last post by:
Hi Some days ago I posted a problem with a query. Thaks to Dave and John, I got a little closer to a solution. Their suggestion was a solution to my problem as I stated it, but the real problem...
3
by: Myron | last post by:
I'm trying to create a query that will tell me which requests took longer than 10 days to move one from particular state to another state. The query I've created returns the correct requests, but...
9
by: Mike R | last post by:
Hi, I cant figure out how to do this.... for example: Select name from mytab order by col1 could return Mike
4
by: Bradley Burton | last post by:
I'm using Allen Brown's code for audit logging (http://allenbrowne.com/AppAudit.html), but I'm having a problem. My aud table doesn't populate with the tracking info at all. I think it might be a...
1
by: Net Virtual Mailing Lists | last post by:
Hello, I have 3 tables which are joined that I need to create a summation for and I just cannot get this to work. Here's an example: CREATE table1 ( id1 INTEGER, title1 VARCHAR
0
by: ZoeNet | last post by:
Hi all, The table structures are below. The table category_cat is built on the adjacency model (where the parent and child entries are both stored in the same table). For my problem, I've...
2
by: AlexanderDeLarge | last post by:
Hi! I got a problem that's driving me crazy and I'm desperately in need of help. I'll explain my scenario: I'm doing a database driven site for a band, I got these tables for their discography...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
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,...

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.