Can anyone See where I'm going wrong?

  • Thread starter Thread starter MikeY
  • Start date Start date
M

MikeY

Hi Everyone,

Can anyone see where I'm going wrong? Win [C#]

OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HOST
017.MDB");

thisConnection.Open();

OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * from
TableTemplate", thisConnection);

OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);

DataSet thisDataSet = new DataSet();



thisAdapter.Fill(thisDataSet,"TableTemplate");



MessageBox.Show("Before Change:" +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);



thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"] = "100";

thisAdapter.Update(thisDataSet, "TableTemplate");



MessageBox.Show("After Change: " +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);





Error being generated is : Syntax error(missing operator) in query
expression "((ID = ?) and ((? IS NULL AND Nam IS NULL) or (NAME = ?) AND....



It keeps ong on from there. But any and all help would be appreciated.



Thanks

MikeY
 
Name is a reserved word and should not be used for table or column names.

Do you have a primary key defined? you need one.
 
Hi Jim

Yes I do have a primary key. Txs for the reserved naming convenvention. I've
been trying to find information on naming convention for Access and other
Databases. I'll look into my naming.

Thanks again.

MikeY

Jim Hughes said:
Name is a reserved word and should not be used for table or column names.

Do you have a primary key defined? you need one.

MikeY said:
Hi Everyone,

Can anyone see where I'm going wrong? Win [C#]

OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HOST
017.MDB");

thisConnection.Open();

OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * from
TableTemplate", thisConnection);

OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);

DataSet thisDataSet = new DataSet();



thisAdapter.Fill(thisDataSet,"TableTemplate");



MessageBox.Show("Before Change:" +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);



thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"] = "100";

thisAdapter.Update(thisDataSet, "TableTemplate");



MessageBox.Show("After Change: " +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);





Error being generated is : Syntax error(missing operator) in query
expression "((ID = ?) and ((? IS NULL AND Nam IS NULL) or (NAME = ?)
AND....



It keeps ong on from there. But any and all help would be appreciated.



Thanks

MikeY
 
http://support.microsoft.com/kb/286335/ is the MS document.

Located with
http://www.google.com/search?hl=en&q=access+reserved+words&btnG=Google+Search

MikeY said:
Hi Jim

Yes I do have a primary key. Txs for the reserved naming convenvention.
I've been trying to find information on naming convention for Access and
other Databases. I'll look into my naming.

Thanks again.

MikeY

Jim Hughes said:
Name is a reserved word and should not be used for table or column names.

Do you have a primary key defined? you need one.

MikeY said:
Hi Everyone,

Can anyone see where I'm going wrong? Win [C#]

OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HOST
017.MDB");

thisConnection.Open();

OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * from
TableTemplate", thisConnection);

OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);

DataSet thisDataSet = new DataSet();



thisAdapter.Fill(thisDataSet,"TableTemplate");



MessageBox.Show("Before Change:" +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);



thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"] = "100";

thisAdapter.Update(thisDataSet, "TableTemplate");



MessageBox.Show("After Change: " +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);





Error being generated is : Syntax error(missing operator) in query
expression "((ID = ?) and ((? IS NULL AND Nam IS NULL) or (NAME = ?)
AND....



It keeps ong on from there. But any and all help would be appreciated.



Thanks

MikeY
 
Thanks Jim,

It turns out to be the naming convention. But, thank you for your links. the
naming convention page will be very handy.

Thanks again,

MikeY

Jim Hughes said:
http://support.microsoft.com/kb/286335/ is the MS document.

Located with
http://www.google.com/search?hl=en&q=access+reserved+words&btnG=Google+Search

MikeY said:
Hi Jim

Yes I do have a primary key. Txs for the reserved naming convenvention.
I've been trying to find information on naming convention for Access and
other Databases. I'll look into my naming.

Thanks again.

MikeY

Jim Hughes said:
Name is a reserved word and should not be used for table or column
names.

Do you have a primary key defined? you need one.

Hi Everyone,

Can anyone see where I'm going wrong? Win [C#]

OleDbConnection thisConnection = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\HOST
017.MDB");

thisConnection.Open();

OleDbDataAdapter thisAdapter = new OleDbDataAdapter("SELECT * from
TableTemplate", thisConnection);

OleDbCommandBuilder thisBuilder = new OleDbCommandBuilder(thisAdapter);

DataSet thisDataSet = new DataSet();



thisAdapter.Fill(thisDataSet,"TableTemplate");



MessageBox.Show("Before Change:" +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);



thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"] = "100";

thisAdapter.Update(thisDataSet, "TableTemplate");



MessageBox.Show("After Change: " +
thisDataSet.Tables["TableTemplate"].Rows[1]["Catagory"]);





Error being generated is : Syntax error(missing operator) in query
expression "((ID = ?) and ((? IS NULL AND Nam IS NULL) or (NAME = ?)
AND....



It keeps ong on from there. But any and all help would be appreciated.



Thanks

MikeY
 
Back
Top