Re: Writing update back to MSAccess table?




Nicholas Paldino [.NET/C# MVP] wrote:

My guess is that the query is actually wrong. The code here is solid
(with the exception of maybe a using statement on the command, but that's a
minor oversight, as well as the fact that you should parameterize this
query). You don't have to do a flush or anything, the provider will take
care of everything.

Are you sure that the tblSettings table has a row where the value of the
setting column is "remainreward"?

If so, then can you provide a complete example (along with mdb file)?

Hi Nicholas,

When the application is first executed, it reads the row with a
[setting] value of 'remainreward' successfully, executing this SQL
statement: SELECT settingval from tblSettings WHERE setting =
'remainreward'

This currently returns a value of '15', which is what is in the table
for this record.

The SQL being executed to update this row when the application closes
is (this is copied from writing the value of CommandString out via
Console.WriteLine):

UPDATE tblSettings SET settingval = '20' WHERE setting = 'remainreward'

However, the value against 'remainreward' in the settingval column
always stays as '15', and never actually updates to '20', as expected.

All the best,

pt

.



Relevant Pages

  • Re: COBOL stored procedure for DB2
    ... Regarding how you precompile the app, you must specify target mfcob to db2 prep, rather than target ibmcob. ... Have you also confirmed that, prior to executing the CALL statement, the host variables specified within the client app have the appropriate values? ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: COBOL stored procedure for DB2
    ... Have you also confirmed that, prior to executing the CALL statement, the ... The DB2 CREATE PROCEDURE statement. ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: How to Log errors while executing ingres sql command
    ... The sql UNIX command sends E_ errors to channel 1. ... While executing ingres 'sql' command, all the errors that raises gets ... I am executing this comand through shell script. ...
    (comp.databases.ingres)
  • EXEC(sqlstatement) Resultset usage
    ... How do I, from within the same stored procedure, use the result of a sql ... statement after executing it using the EXECcommand? ...
    (microsoft.public.sqlserver.programming)
  • Re: Problems installing XP SP2!
    ... package source directory and make sure the that XPSPS2sms.exe file exists in ... in your SMS Program command line property. ... > Executing program as a script ... > OnOptionalExecutionRequests failed for program Automated upgrade from XP ...
    (microsoft.public.sms.admin)