Alaska Software Inc. - SqlExpress and Topdown
Username: Password:
AuthorTopic: SqlExpress and Topdown
Ben BodensteinSqlExpress and Topdown
on Fri, 16 Sep 2016 11:20:23 +0200
Hi all,

Has anybody tried using Topdown's tdSqlBrow for MySql?
I am getting the browse to work nicely but when trying to update or 
change anything it just doesn't work.

It seems from the MySql log that the update statement sent to the server 
is not in the correct format since it looks something like this:

UPDATE
    postcode
SET
    `CODE` = 1,
    `ACCDESC` = 'HEFFING BETAALBAAR',
    `ACCDESCE` = 'LEVIES PAYABLE',
    `DTKT` = 'D',
    `CRPOST` = 801,
    `DBPOST` = 700,
    `INTEREST` = 1,
    `DB_BLDG` = 1,
    `DB_CODE` = 123,           Field I want to change
    `BUD_CODE` = 'ZZ11'
WHERE `CODE` IS NULL            Should be WHERE 'CODE'=1

Any ideas would be appreciated.

Thanks,
Ben
Raymond FischbachRe: SqlExpress and Topdown
on Fri, 16 Sep 2016 14:54:27 +0200
Ben Bodenstein avait écrit le 16/09/2016 :
> Hi all,
>
> Has anybody tried using Topdown's tdSqlBrow for MySql?
> I am getting the browse to work nicely but when trying to update or change 
> anything it just doesn't work.
>
> It seems from the MySql log that the update statement sent to the server is 
> not in the correct format since it looks something like this:
>
> UPDATE
>     postcode
> SET
>     `CODE` = 1,
>     `ACCDESC` = 'HEFFING BETAALBAAR',
>     `ACCDESCE` = 'LEVIES PAYABLE',
>     `DTKT` = 'D',
>     `CRPOST` = 801,
>     `DBPOST` = 700,
>     `INTEREST` = 1,
>     `DB_BLDG` = 1,
>     `DB_CODE` = 123,           Field I want to change
>     `BUD_CODE` = 'ZZ11'
> WHERE `CODE` IS NULL            Should be WHERE 'CODE'=1
>
> Any ideas would be appreciated.
>
> Thanks,
> Ben

Hi Ben,

This is the way I do it:
   nId := oTmpCur:FieldGet('iddocs')
   oStmt := oConn:NewStatement()
   oStmt:SQLString := "UPDATE docs SET lastversion = 'N'"
   oStmt:SQLString += " WHERE iddocs = " + Alltrim(Str(nId))
   oStmt:Execute()
   oStmt:destroy()

Best regards,
Raymond