473,326 Members | 2,076 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,326 software developers and data experts.

insert into error not recognized

Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco' ,
'Antonioff' , 'ferfe' , 'p*********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio
Sep 5 '05 #1
7 1207

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco'
,
'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio


Hi Antonio,
Have you checked the value types - e.g: is the '333333' a string or a long
value within database?
Sep 5 '05 #2
I think 'password' is a reserved word in Jet. Try enclosing it in square
brackets ([]).

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco' ,
'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio

Sep 5 '05 #3
I've changed the password filed with a pwd file, but I've again the error
....
Thanks the same

"Siva M" <sh******@online.excite.com> ha scritto nel messaggio
news:eI**************@TK2MSFTNGP14.phx.gbl...
I think 'password' is a reserved word in Jet. Try enclosing it in square
brackets ([]).

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password, Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco' , 'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio

Sep 5 '05 #4
The field phone is a string ... I think is it right in this way, hope so
"James Jenkins" <Ja***@noSPAMtamarsolutions.co.uk> ha scritto nel messaggio
news:uZ*************@TK2MSFTNGP15.phx.gbl...

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password, Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco' ,
'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio
Hi Antonio,
Have you checked the value types - e.g: is the '333333' a string or a

long value within database?

Sep 5 '05 #5
Antonio D'Ottavio wrote:
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco' ,
'Antonioff' , 'ferfe' , 'p*********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio

Antonio,

Have you tried using the .Net debugger to simply pick up your insertCmd string
at the point you are ready to send it and pasting it exactly as built into the
Access SQL window? Does that work? If not, your problem is indeed with the
syntax, not a .Net problem at all.

HTH,
-rick-
Sep 5 '05 #6
try removing the '@' in the email and see if it works. for grins.

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco'
,
'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio

Sep 5 '05 #7
You will be fighting with this block of code from now until the water's
pumped out of New Orleans if you don't convert it to a Parameter-based
Command. The Parameters handle the framing issues (some of which you have
not encountered yet) and other issues that you have seen.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Antonio D'Ottavio" <po********@etantonio.it> wrote in message
news:eN**************@TK2MSFTNGP14.phx.gbl...
Good morning,
I've the following error
Syntax error in INSERT INTO statement
But I do not found any error in this code

OleDbconn = new OleDbConnection(sConnessioneDb);
string insertCmd = "insert into Organizzatori (NomeUtente, Password,
Nome, Cognome, IndirizzoPostaElettronica, Telefono) values ('eta' , 'eco'
,
'Antonioff' , 'ferfe' , 'po********@etantonio.it' , '333333')";
OleDbCommand myCommand = new OleDbCommand(insertCmd, OleDbconn);
myCommand.Connection.Open();
try
{
myCommand.ExecuteNonQuery();
}
catch (OleDbException ex)
{
lblMsg1.Text = ex.Message ;
}
myCommand.Connection.Close();

Can you help me to discover the problem, I'm using an Access DB.

Many thanks

Antonio D'Ottavio

Sep 5 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Arnab Nandi | last post by:
We are using the Sun Workshop 6 C++ compiler to compile some CPP files. The command line looks like follows: - CC -g -xsb -c -o output/x.o x.cpp We get the following error: - CC: language...
7
by: Antonio D'Ottavio | last post by:
Good morning, I've the following error Syntax error in INSERT INTO statement But I do not found any error in this code OleDbconn = new OleDbConnection(sConnessioneDb); string insertCmd =...
7
by: Arek | last post by:
Hey, I am inserting values in the table: Dim sqlcomm1 As SqlCommand = New SqlCommand("INSERT INTO tblTasks (idTask, outdate) VALUES ('" & IDTask.text & "','" & txtOutdate.Text & "')", conn)...
2
by: Manuel Canas | last post by:
Hi there, This is the Code ; cnSQL = New SqlConnection(ConnectionString) cmSQL = New SqlCommand(strSQL, cnSQL) strSQL = "INSERT tb_product VALUES(@ServiceCode,@ServiceName,@Price)" cmSQL =...
10
by: deathtospam | last post by:
My employer is starting to take the first steps towards migrating its Classic ASP codebase to ASP.NET v2.0. We have a copy of our existing website on the new Windows Server 2003 R2 test server,...
1
by: database | last post by:
I AM FACING A PROBLEM WHEN I ACCESS ONE OF THE PAGES. IT USED TO WORK BEFORE BUT AFTER RESTARTING THE APPLICATION SEVER IT GIVES THE FOLLOWING ERROR. - Server Error ...
6
by: reppisch | last post by:
Hi Ng, I have a multiset for keeping elements sorted in a container but key values may also be equal. Is there any guaranteed traversal order within the duplicate keys of a multimap? When...
2
by: aaron1234nz | last post by:
I am trying to insert new rows into a table but there are a few tricky things I have not been able to get my head around. 1. I need to insert a unique ID in each row. 2. I need to insert rows...
3
by: emlimeng | last post by:
hi everyone, I need help on an error message. I am working on an environment that Access2003 (adp) as a front end and links to SQL server as a back end. I am creating a table, which requests users...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.