The markup file looks like this:

[Weather] Filetype=VARYING Delimiter=" Separator=, CharSet=ascii Field1=id,Char,20,00,00 Field2=username,Char,20,00,20 Field3=city,Char,20,00,40 Field4=time,Char,05,00,60 Field5=count,Char,10,00,65 

I connect to the database like this:

 with Table1 do begin TableType := ttASCII; DatabaseName := exePath; TableName := 'Weather'; Open; end; 

I write the data like this:

  Table1.Insert; Table1.FieldByName('id').AsAnsiString := '1234567'; Table1.FieldByName('username').AsAnsiString := 'aaaaa'; Table1.FieldByName('city').AsAnsiString := 'Москва'; Table1.FieldByName('time').AsAnsiString := '4'; Table1.FieldByName('count').AsAnsiString := '0'; Table1.Post; 

And the result looks like this:

 "1234567","aaaaa","######","4","0" 

Tell me, please, what could be the problem?

  • 3
    So it can use not ASCII, in which the location of national characters is not regulated, but (if we continue to consider single-byte ones) Windows-1251, for example? - kami
  • what could be the problem? The problem is in the encoding. 100% - kot-da-vinci
  • one
    @ kot-da-vinci, of course, in the encoding, and what to do? Yes, I probably incorrectly asked a question at the end - St-dimka
  • one
  • 2
    @ St-dimka - take the trouble - issue as an answer, specifying valid charset values. I hope you have a help file listed in the answer given in the link? - kami

1 answer 1

The use of ANSIINTL as an encoding in a markup file (* .sch) helped, now its title looks like this:

 [Weather] Filetype=VARYING Delimiter=" Separator=, CharSet=ANSIINTL 

A detailed description of the contents of the markup * .sch is in the help file bde32.hlp in the topic "Binding external schema to text tables". The "Language drivers" heading describes the possible Charset values.

Several possible charset values ​​that may come in handy

Thanks @kami for the help, source: https://stackoverflow.com/questions/819482/what-standard-does-bde-use-for-sch-schema-files/822016#822016

  • Thank. Strange that ANSIINTL itself is not ... - kami
  • There is. It is at the bottom, but for the paradox of the DB, I decided not to include in the list Yes, weird then it turns out, but not to redo the whole answer now - St-dimka
  • @ St-dimka do not have to redo the whole answer, make a correction in your answer with a comment about ANSIINTL. - kot-da-vinci