473,411 Members | 1,982 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,411 software developers and data experts.

DataTable on MSAccess Table with 100+ fields

Hi,

I've got a table in MsAccess with 100+ fields.
If I fill a tabletable with this table , change some values , get the
update-command via commandbuilder , the update fails.
This because the commandbuilder adds a where clause that contains all
the fields in the datatable ( to check whether the record has been
changed since the fill ).
Because MSAccess does not allow more then 99 fields in the where
clause, the update fails offcourse.

So I was trying to adapt the sqlcommend for update itself by replacing
the where clause with only a where of it's primary key.
But even then when you do the update-commend, the tableadapter add's
the whole where-clause again.

Is there a way to avoid that he uses this where-clause itself and only
add the primary key ( or maybe a where we can alter ourselfs )?

Regards,
Sven Peeters
Belgium

Nov 8 '07 #1
3 1988
I would two things.
Either, change for SQL Express 2005 (which is totally free), if this
possible for sure.
Otherwise, you could create a your own update string and pass it to the
DataAdapter.

"Icemokka" <ic******@gmail.coma écrit dans le message de news:
11**********************@i38g2000prf.googlegroups. com...
Hi,

I've got a table in MsAccess with 100+ fields.
If I fill a tabletable with this table , change some values , get the
update-command via commandbuilder , the update fails.
This because the commandbuilder adds a where clause that contains all
the fields in the datatable ( to check whether the record has been
changed since the fill ).
Because MSAccess does not allow more then 99 fields in the where
clause, the update fails offcourse.

So I was trying to adapt the sqlcommend for update itself by replacing
the where clause with only a where of it's primary key.
But even then when you do the update-commend, the tableadapter add's
the whole where-clause again.

Is there a way to avoid that he uses this where-clause itself and only
add the primary key ( or maybe a where we can alter ourselfs )?

Regards,
Sven Peeters
Belgium

Nov 8 '07 #2
On 8 nov, 19:40, "Jonathan Boivin" <d...@cyberinternautes.netwrote:
I would two things.
Either, change for SQL Express 2005 (which is totally free), if this
possible for sure.
Otherwise, you could create a your own update string and pass it to the
DataAdapter.

"Icemokka" <icemo...@gmail.coma écrit dans le message de news:
1194535721.781959.245...@i38g2000prf.googlegroups. com...
Hi,
I've got a table in MsAccess with 100+ fields.
If I fill a tabletable with this table , change some values , get the
update-command via commandbuilder , the update fails.
This because the commandbuilder adds a where clause that contains all
the fields in the datatable ( to check whether the record has been
changed since the fill ).
Because MSAccess does not allow more then 99 fields in the where
clause, the update fails offcourse.
Unfortunately that is not possibel ( SQL Express ), that would be much
easier.

I was also thinking about generating the SQL myself, but when I set
the UpdateCommand of the DataAdapter, he replaces it with the
UpdateCommand of the CommandBuilder ( with the full where-clause ).
Another thing bother's my is that some of my tables have 'image'
fields that contain files. Another restriction of MsAccess is that a
query cannot contain more than 64000 characters.
So even if I can force the UpdateCommand, ik my image field is too big
( like 64K for example ), the query fails to and updating is
impossible.

Is there no connected way in ADO.Net to update a recordset that
doesn't use a Query tu opdate?

Regards,
Sven Peeters
So I was trying to adapt the sqlcommend for update itself by replacing
the where clause with only a where of it's primary key.
But even then when you do the update-commend, the tableadapter add's
the whole where-clause again.
Is there a way to avoid that he uses this where-clause itself and only
add the primary key ( or maybe a where we can alter ourselfs )?
Regards,
Sven Peeters
Belgium- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -

Nov 9 '07 #3
I have not used the TableAdapter much, but I believe that you can override
the commands that it generates. In the Ide, open the dataset containing the
table, near the bottom, click on the tableadapter, and then in the
properties, click on the + next to "UpdateCommand" and then modify the
command text and parameters collection to meet your needs. I believe that
you could also right click the tableadapter (from above) and then select
configure. Select "Advanced Options" and uncheck the "Generate Insert,
Update...". Maybe that will keep it from overriding the update command you
had generated in code. And I think that there is also a third option.
Again, right click the TableAdapter, and select "Add Query". Select the
"Update" radio button and build a new/different update command that (I think)
you would just invoke something like MyTableAdapter.MyUpdateCommand.
Do me a favor and let us know how this works for you. As I said, I havent
used TableAdapters much and am curious.
--
Terry
"Icemokka" wrote:
On 8 nov, 19:40, "Jonathan Boivin" <d...@cyberinternautes.netwrote:
I would two things.
Either, change for SQL Express 2005 (which is totally free), if this
possible for sure.
Otherwise, you could create a your own update string and pass it to the
DataAdapter.

"Icemokka" <icemo...@gmail.coma icrit dans le message de news:
1194535721.781959.245...@i38g2000prf.googlegroups. com...
Hi,
I've got a table in MsAccess with 100+ fields.
If I fill a tabletable with this table , change some values , get the
update-command via commandbuilder , the update fails.
This because the commandbuilder adds a where clause that contains all
the fields in the datatable ( to check whether the record has been
changed since the fill ).
Because MSAccess does not allow more then 99 fields in the where
clause, the update fails offcourse.
Unfortunately that is not possibel ( SQL Express ), that would be much
easier.

I was also thinking about generating the SQL myself, but when I set
the UpdateCommand of the DataAdapter, he replaces it with the
UpdateCommand of the CommandBuilder ( with the full where-clause ).
Another thing bother's my is that some of my tables have 'image'
fields that contain files. Another restriction of MsAccess is that a
query cannot contain more than 64000 characters.
So even if I can force the UpdateCommand, ik my image field is too big
( like 64K for example ), the query fails to and updating is
impossible.

Is there no connected way in ADO.Net to update a recordset that
doesn't use a Query tu opdate?

Regards,
Sven Peeters
So I was trying to adapt the sqlcommend for update itself by replacing
the where clause with only a where of it's primary key.
But even then when you do the update-commend, the tableadapter add's
the whole where-clause again.
Is there a way to avoid that he uses this where-clause itself and only
add the primary key ( or maybe a where we can alter ourselfs )?
Regards,
Sven Peeters
Belgium- Tekst uit oorspronkelijk bericht niet weergeven -
- Tekst uit oorspronkelijk bericht weergeven -


Nov 12 '07 #4

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

Similar topics

3
by: VM | last post by:
How can I copy the contents of one datatable to another datatable? I've already the source table so I only need to copy its rows. Thanks.
9
by: VMI | last post by:
We have this huge application that's based on storing tons of data on a dataTable. The only problem we're having is that storing LOTS of data (1 million records) into a datatable will slow down the...
4
by: Kris Rudin | last post by:
I am displaying a table of information on a web page, using an asp:table that I populate dynamically. On this page I give the user the options to group the rows by certain fields, and/or filter the...
0
by: Manish | last post by:
Hey Guys I am using a datagrid to extract information out of SQL Server datbase. The fields extracted are category,week,budget,Last Year,Forecast and Projection. Also i add a calculated column...
6
by: WebBuilder451 | last post by:
I'd like to create a datatable and add rows to it, but not make it part of a dataset. so far i've not seen too many examples of this. I believe it can be done. does anyone know of an example?...
1
by: Lars E | last post by:
Hi all I have a small problem. I have a datatable with 8 columns. But it is only data in 5 of the columns. Data for the remaing 3 columns is in another dataset. I Want to run trough the...
4
by: Rich | last post by:
Hello, I need to store various values that I will need to look up later on. I have been using hashtables and arraylists. But I can only store 2 items per row in a hashtable - key, value, and...
3
by: SimYing | last post by:
Is there any way to read and query data from Microsoft Access? Actually, i had anapplication which build using Python, wxPython, NumArray and etc. Now i need to find a way to retrieve data from...
0
nehashri
by: nehashri | last post by:
hi, I need one help regarding Asp with MsAccess database. Problem. ======== i want to retrive stored image from the MSAccess database using asp.
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.