1. Beatrix Willius
  2. Valentina Database ADK
  3. Суббота, Ноябрь 24 2018, 07:04 AM
  4.  Подписаться через email
Valentina really is sensitive to encodings. I thought I was losing what was left of my mind. Here is the problem:

I got very simple SQL to export some data:


dim theSQL as string = "select *, Recid from Attachment where MailID = " + Str(theMailID) + " and AttachmentName = '" + AttachmentNames(0) + "'"
dim theCursor as VCursor = theDatabase.SqlSelect(theSQL, EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom)


When testing the RecordCount of the cursor is 1. Everything is fine.

Then I want to use a VPreparedStatement instead and use:


dim theSQL as String = "select *, recid from Attachment where mailid = ? and AttachmentName = ?"
dim thePrepared as VPreparedStatement = theDatabase.Prepare(theSQL)
thePrepared.BindInt64(0, theMailID)
thePrepared.BindText(1, AttachmentNames(0))
dim theCursor as VCursor = thePrepared.SqlSelect(EVCursorLocation.kServerSide, EVLockType.kNoLocks, EVCursorDirection.kRandom)


RecordCount of the cursor is 0. The SQL is so simple, but the prepared statements are impossible to debug. Then I thought: wait, Valentina is picky with encodings. And when checking the data in AttachmentNames(0) I saw that the encoding of the data was ASCII instead of UTF8. After defining the correct encoding everything works fine.

Bug or feature?
Комментарий
There are no comments made yet.
Ruslan Zasukhin Ответ принят
I wonder, names were German?
Комментарий
There are no comments made yet.
Beatrix Willius Ответ принят
No, the problem occurs for plain ASCII data. If had unicode names I would have seen the problem much easier.
Комментарий
There are no comments made yet.
  • Страница :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories