RTrim and UPDATE, DELETE problem

  • Thread starter Thread starter lado
  • Start date Start date
L

lado

Hello,

I have an Access table called Products which
contains text field Description.
When I use Data Adapter Configuration Wizard to generate
the SQL statements for that table it says that it couldn't
generate UPDATE and DELETE statements.
The following is a code snippet for SELECT statement (after
using Query Builder and after adding RTrim):

SELECT IDProduct, RTrim(Description) AS Description
FROM Products

However, if I don't use RTrim, the UPDATE and DELETE
statements will be generated.

Besides that, if I write manually UPDATE and DELETE
statements and connect the dataset (after filling) to the
datagrid, then the fields in the datagrid which were
RTrimmed will be readonly?

Does anybody have any ideas what is going wrong?
 
You are going to have to manually create your update and delete statements.

What is happening is the Command builder is not able to auto generate a
command, as a command like:

UPDATE Products
SET IDProduct = @IDProduct,
RTrim(Description) = @Description

is an illegal SQL statement. Same with:

DELETE FROM Products
WHERE IDProduct = @IDProduct
RTrim(Description) = @Description

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 
Back
Top