[V4RB] Different results with SQL and BaseObject

Christer Olsson christer at ljusaideer.se
Mon Apr 14 23:36:33 CDT 2003


When storing strings containing ASCII > 127 I get different results when using SQLExecute and BaseObject Record methods. I'm storing values entered by the user in editfields, and I convert them to MacRoman before storing them with:

s = convertEncoding(value, encodings.macRoman)

This will store a "raw" UTF string in the database:
  
recCount = app.mEOrderDatabase.SQLExecute("UPDATE Installningar SET varde_fld = '" + s  + "' WHERE namn_fld = " + falt)

But this will store MacRoman encoded strings:

app.mEOrderDatabase.mInstallningar.vardeFld.SetString(s)
app.mEOrderDatabase.mInstallningar.namnFld.SetString(falt)
app.mEOrderDatabase.mInstallningar.AddRecord

i.e if the Editfield.text is "Lösenord" the SQLExecute will store "Lˆsenord", but the BaseObject method will store "Lösenord".
-- 

  *************************************************************
  Christer Olsson   PO Box 9160        Phone +46 40 25 85 85
  Ljusa Idéer AB    SE-200 39 Malmoe   Fax +46 40 25 85 89
  Kantyxegatan 5    Sweden             http://www.ljusaideer.se


More information about the Valentina mailing list