From: Jesper Lauridsen on
Hello everybody

I try to use the function update to export data to an access database and replacing existing data.

My code:

Table='Price''
colnames = {''Frugt'}
exdata(1)={1000}
whereclause='where Weight=10'
update(conn,Table,colnames,exdata,whereclause)

It worked fine

But if i try to change more than one value in the column Frugt I get an error

Table='Price''
colnames = {''Frugt'}
exdata={'100';'200}
whereclause={'where Weight=10';'where Weight=12'}

update(conn,Table,colnames,exdata,{'where Weight=10';'where Weight=2'})

The error I get is:

??? Error using ==> horzcat
The following error occurred converting from char to cell:
Error using ==> cell
Conversion to cell from char is not possible.

Error in ==> database.update at 146
writeString = [startOfString dataString ' ' whereClause];




The format of the table ind access is number (numeric data)
From: Jesper Lauridsen on
"Jesper Lauridsen" <jesperholst_5(a)hotmail.com> wrote in message <hci5od$rpo$1(a)fred.mathworks.com>...
> Hello everybody
>
> I try to use the function update to export data to an access database and replacing existing data.
>
> My code:
>
> Table='Price''
> colnames = {''Frugt'}
> exdata(1)={1000}
> whereclause='where Weight=10'
> update(conn,Table,colnames,exdata,whereclause)
>
> It worked fine
>
> But if i try to change more than one value in the column Frugt I get an error
>
> Table='Price''
> colnames = {''Frugt'}
> exdata={'100';'200}
> whereclause={'where Weight=10';'where Weight=12'}
>
> update(conn,Table,colnames,exdata,{'where Weight=10';'where Weight=2'})
>
> The error I get is:
>
> ??? Error using ==> horzcat
> The following error occurred converting from char to cell:
> Error using ==> cell
> Conversion to cell from char is not possible.
>
> Error in ==> database.update at 146
> writeString = [startOfString dataString ' ' whereClause];
>
>
>
>
> The format of the table ind access is number (numeric data)


Anybody that can help

Best regards

Jesper