RTrim and UPDATE, DELETE problem

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?
 
C

Cowboy \(Gregory A. Beamer\)

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!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top