SQL Question

HARRY

Active Member
Licensed User
Longtime User
Hallo, SQLite experts!

On the following statements :

cmd.CommandText="UPDATE WPOILABEL_V1 SET PHOTO1 = Text1 ,PHOTO2 =Text2, PHOTO3 = Text3 WHERE ID=ActCampID;"
cmd.ExecuteNonQuery

I get the error message: SQLite error: No such column Text1

WPOILABEL_V1 is really a table and PHOTO1 , PHOTO2 and PHOTO3 are really columns.

What am i doing wrong?

Harry
 

Fontanus

Member
Licensed User
Hello Harry,

test the following syntax:

cmd.CommandText="UPDATE WPOILABEL_V1 SET PHOTO1 = '" &Text1& "' , PHOTO2 = '" &Text2& "', PHOTO3 = '" &Text3& "' WHERE ID= '" &ActCampID& "' "
cmd.ExecuteNonQuery

Bon Chance

Fontanus
 

HARRY

Active Member
Licensed User
Longtime User
Erel and Fontanus,

Thanks for your help; it works now fine. I was confused where to use single and double quotes and &&.


Harry
 

HARRY

Active Member
Licensed User
Longtime User
Hallo Fontanus,

Back to an old problem.

Can you explain me the need to use '"& ___&"' around each variable. Who is doing what with each pair of symbols? In the case I presented Text1, etc just are variables, local to the update sub

I have tried your sample code and that of Erel. I got your solution working, that of Erel not. No error was raised , but the row just was not updated. I don't know why.

So, I was happy with your solution until version 5 was released. Now none of both solutions work on the PDA. See also my new topic on this subject.

Do you have an idea?

Harry
 

HARRY

Active Member
Licensed User
Longtime User
Erel,

Thanks for the explanation of quotes, etc.. Looking at the sentence in a msgbox makes it clear.

The problem is solved. I used the cmd.New1() and Reader.new1 repeatingly to refresh a table after update of the data base. SQLite desktop accepted this, SQlite device gave error messxages: two for each update.

I now have added dispose and AddObject for both and now it works also on the device.

These things are beyond your control I guess?

Harry
 
Top