WideString and DBGrid

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQLite in Delphi and C++Builder
Post Reply
totte_karlsson
Posts: 6
Joined: Fri 12 Feb 2016 17:19

WideString and DBGrid

Post by totte_karlsson » Mon 13 Jun 2016 18:23

Hello,
I have a sqlite table that has a field named 'notes' and declared as WideString.

When I try to show the field in a DBGrid using XE3 C++ Builder, I get into problem.

I have written a GetText handler for the field in the ClientDataSet component, that looks like this (just for testing):

Code: Select all

void __fastcall TDataModule1::ribbonsCDSnotesGetText(TField *Sender, UnicodeString &Text,
          bool DisplayText)
{
	TField* field = dynamic_cast<TField*>(Sender);

	if(field == ribbonsCDSnotes)
	{
	    field->AsWideString;
		Text = "Test2";
	}
}
When hitting the line field->AsWideString; en error is thrown, ESQLiteError with message 'near ...: syntax error"

Any tips on how to get past this?
If I define the field as VARCHAR I don't have these problems.

Thanks,
tk

totte_karlsson
Posts: 6
Joined: Fri 12 Feb 2016 17:19

Re: WideString and DBGrid

Post by totte_karlsson » Mon 13 Jun 2016 22:44

Found that the problem was related to a bad name of a field. The field was named 'order' and that caused the problems.. :(

MaximG
Devart Team
Posts: 1650
Joined: Mon 06 Jul 2015 11:34

Re: WideString and DBGrid

Post by MaximG » Tue 14 Jun 2016 14:08

We are glad to see the problem resolved. Please don't hesitate to contact us with questions concerning dbExpress driver for SQLite usage

Post Reply