Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-09

FreePascal/Lazarus Components to access Sqlite databases --> Tutorial 01 - A basic address book

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luiz Americo Pereira Camara
to Usuario Anónimo
Usuario An?nimo wrote 9 lines
Hello, I download the file dataset_tutorial_01.zip from http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. When I try compile the project I get the next error: Project raised exception class 'EDatabaseError'. Why?

Sqlite3 expects UTF8 encoded file names. Probably your config dir path contains accented characters and GetAppConfigDir returns ansi encoded instead of UTF8.

Replace

FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) +
'data.db';

by

FileName :=
UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) +
'data.db');

Luiz

Reply by email

Mattias Gaertner
to Luiz Americo Pereira Camara
Show quoted text 25 lines
Usuario An?nimo wrote: > Hello, I download the file dataset_tutorial_01.zip from > http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. > > When I try compile the project I get the next error: > > Project raised exception class 'EDatabaseError'. > > Why? > Sqlite3 expects UTF8 encoded file names. Probably your config dir path contains accented characters and GetAppConfigDir returns ansi encoded instead of UTF8. Replace FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + 'data.db'; by FileName := UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + 'data.db');

or

FileName := IncludeTrailingPathDelimiter(GetAppConfigDirUTF8(False)) + 'data.db';

(unit FileUtil)

Mattias

Reply by email

Usuario Anónimo
to Luiz Americo Pereira Camara: Sqlite3 expects UTF8 encoded file names. Probably your config dir path contains accented…

Now the project run.

Thanks.

2008/9/13 Luiz Americo Pereira Camara :

Show quoted text 34 lines
Usuario An?nimo wrote: > Hello, I download the file dataset_tutorial_01.zip from > http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. > > When I try compile the project I get the next error: > > Project raised exception class 'EDatabaseError'. > > Why? > Sqlite3 expects UTF8 encoded file names. Probably your config dir path contains accented characters and GetAppConfigDir returns ansi encoded instead of UTF8. Replace FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + 'data.db'; by FileName := UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + 'data.db'); Luiz _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Usuario Anónimo
to Mattias Gaertner: On Fri, 12 Sep 2008 22:18:41 -0300 or FileName :=…

I get the error:

tutorial01.pas(44,65) Error: Identifier not found "GetAppConfigDirUTF8"

2008/9/13 Mattias Gaertner :

Show quoted text 42 lines
On Fri, 12 Sep 2008 22:18:41 -0300 Luiz Americo Pereira Camara wrote: > Usuario An?nimo wrote: > > Hello, I download the file dataset_tutorial_01.zip from > > http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. > > > > When I try compile the project I get the next error: > > > > Project raised exception class 'EDatabaseError'. > > > > Why? > > > > Sqlite3 expects UTF8 encoded file names. Probably your config dir > path contains accented characters and GetAppConfigDir returns ansi > encoded instead of UTF8. > > Replace > > FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + > 'data.db'; > > by > > FileName := > UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + > 'data.db'); or FileName := IncludeTrailingPathDelimiter(GetAppConfigDirUTF8(False)) + 'data.db'; (unit FileUtil) Mattias _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Usuario Anónimo
to Usuario Anónimo

I follow the steps to make a identic project to
dataset_tutorial_01.zip but I can?t write text into the TDBGrid.

Why?

Regards.

2008/9/13 Usuario An?nimo :

Show quoted text 48 lines
I get the error: tutorial01.pas(44,65) Error: Identifier not found "GetAppConfigDirUTF8" 2008/9/13 Mattias Gaertner : > On Fri, 12 Sep 2008 22:18:41 -0300 > Luiz Americo Pereira Camara wrote: > >> Usuario An?nimo wrote: >> > Hello, I download the file dataset_tutorial_01.zip from >> > http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. >> > >> > When I try compile the project I get the next error: >> > >> > Project raised exception class 'EDatabaseError'. >> > >> > Why? >> > >> >> Sqlite3 expects UTF8 encoded file names. Probably your config dir >> path contains accented characters and GetAppConfigDir returns ansi >> encoded instead of UTF8. >> >> Replace >> >> FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + >> 'data.db'; >> >> by >> >> FileName := >> UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + >> 'data.db'); > > or > > FileName := IncludeTrailingPathDelimiter(GetAppConfigDirUTF8(False)) + 'data.db'; > > (unit FileUtil) > > Mattias > > _______________________________________________ > Lazarus mailing list > > http://www.lazarus.freepascal.org/mailman/listinfo/lazarus >

Reply by email

Usuario Anónimo
to Usuario Anónimo

I solve this, I fill the properties TDBGrid --> Columns --> Field Name and I can write text into the TDBGrid.

2008/9/13 Usuario An?nimo :

Show quoted text 57 lines
I follow the steps to make a identic project to dataset_tutorial_01.zip but I can?t write text into the TDBGrid. Why? Regards. 2008/9/13 Usuario An?nimo : > I get the error: > > tutorial01.pas(44,65) Error: Identifier not found "GetAppConfigDirUTF8" > > 2008/9/13 Mattias Gaertner : >> On Fri, 12 Sep 2008 22:18:41 -0300 >> Luiz Americo Pereira Camara wrote: >> >>> Usuario An?nimo wrote: >>> > Hello, I download the file dataset_tutorial_01.zip from >>> > http://www.geocities.com/camara_luiz/docs/dataset/dataset-tutorial-01.html. >>> > >>> > When I try compile the project I get the next error: >>> > >>> > Project raised exception class 'EDatabaseError'. >>> > >>> > Why? >>> > >>> >>> Sqlite3 expects UTF8 encoded file names. Probably your config dir >>> path contains accented characters and GetAppConfigDir returns ansi >>> encoded instead of UTF8. >>> >>> Replace >>> >>> FileName := IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + >>> 'data.db'; >>> >>> by >>> >>> FileName := >>> UTF8Encode(IncludeTrailingPathDelimiter(GetAppConfigDir(False)) + >>> 'data.db'); >> >> or >> >> FileName := IncludeTrailingPathDelimiter(GetAppConfigDirUTF8(False)) + 'data.db'; >> >> (unit FileUtil) >> >> Mattias >> >> _______________________________________________ >> Lazarus mailing list >> >> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus >> >

Reply by email