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

Re: Can anyone See where I'm going wrong? by Mark

Mark
Fri Jul 14 14:23:05 CDT 2006

Just a guess but the Rows collection is zero based so the first row is
Row[0]

--
Best regards
Mark Baldwin

"MikeY" <mikesinfo@yaho.com> wrote in message
news:OSNGsZ2pGHA.4196@TK2MSFTNGP04.phx.gbl...
> 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
>
>



Re: Can anyone See where I'm going wrong? by Jim

Jim
Fri Jul 14 18:07:35 CDT 2006

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" <mikesinfo@yaho.com> wrote in message
news:OSNGsZ2pGHA.4196@TK2MSFTNGP04.phx.gbl...
> 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
>
>



Re: Can anyone See where I'm going wrong? by MikeY

MikeY
Sat Jul 15 09:36:44 CDT 2006

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" <NOSPAMJ3033@Hotmail.com> wrote in message
news:erpSFp5pGHA.4684@TK2MSFTNGP05.phx.gbl...
> 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" <mikesinfo@yaho.com> wrote in message
> news:OSNGsZ2pGHA.4196@TK2MSFTNGP04.phx.gbl...
>> 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
>>
>>
>
>



Re: Can anyone See where I'm going wrong? by Jim

Jim
Sat Jul 15 10:05:31 CDT 2006

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" <mikesinfo@yaho.com> wrote in message
news:uBv%23YwBqGHA.2348@TK2MSFTNGP03.phx.gbl...
> 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" <NOSPAMJ3033@Hotmail.com> wrote in message
> news:erpSFp5pGHA.4684@TK2MSFTNGP05.phx.gbl...
>> 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" <mikesinfo@yaho.com> wrote in message
>> news:OSNGsZ2pGHA.4196@TK2MSFTNGP04.phx.gbl...
>>> 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
>>>
>>>
>>
>>
>
>



Re: Can anyone See where I'm going wrong? by MikeY

MikeY
Tue Jul 18 07:57:54 CDT 2006

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" <NOSPAMJ3033@Hotmail.com> wrote in message
news:%237qyeACqGHA.5108@TK2MSFTNGP05.phx.gbl...
> 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" <mikesinfo@yaho.com> wrote in message
> news:uBv%23YwBqGHA.2348@TK2MSFTNGP03.phx.gbl...
>> 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" <NOSPAMJ3033@Hotmail.com> wrote in message
>> news:erpSFp5pGHA.4684@TK2MSFTNGP05.phx.gbl...
>>> 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" <mikesinfo@yaho.com> wrote in message
>>> news:OSNGsZ2pGHA.4196@TK2MSFTNGP04.phx.gbl...
>>>> 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
>>>>
>>>>
>>>
>>>
>>
>>
>
>