Board index » cppbuilder » ADO with unicode querys...
Bernd Muent
![]() CBuilder Developer |
Bernd Muent
![]() CBuilder Developer |
ADO with unicode querys...2005-04-28 04:22:23 PM cppbuilder95 ... seems not to be possible. I'm using Jet engine 4.0 to access a mdb that contains some chinese unicode characters. With .net and MFC it's working fine, but with VCL/ADO every "insert into to test values('\x4e01');" results in a "?". Trying to get data from the mdb with "select * from test where field1 like '%\x4e01'" does not return anything :-( Are there any changes to get this working or do I need an additional component like ELPack? Thanks for tips, Bernd |
Viatcheslav V. Vassiliev
![]() CBuilder Developer |
2005-04-29 03:50:53 AM
Re:ADO with unicode querys...
Which components do you use? Try use TADOCommand and CommandText - it is
WideString. It seems that somewhere there is convertion AnsiString -> WideString. //------------------------------------------ Regards, Vassiliev V. V. www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Bernd Muent" < XXXX@XXXXX.COM >???????/???????? ? ???????? ?????????: Quote... seems not to be possible. |
Bernd Muent
![]() CBuilder Developer |
2005-04-29 05:51:48 PM
Re:ADO with unicode querys...
Viatcheslav V. Vassiliev schrieb:
QuoteWhich components do you use? Try use TADOCommand and CommandText - it is WideString wS="Insert into test (f1,f2) values ('\u4e01 ','AAA')"; ac->CommandText=wS; ac->Connection=dbConn; ac->Execute(); delete ac; And this produces an entry "?"/"AAA" in the mdb-Database (viewing in Access, not in CBuilder!). Greetings, Bernd {smallsort} |
Viatcheslav V. Vassiliev
![]() CBuilder Developer |
2005-05-02 04:00:54 AM
Re:ADO with unicode querys...
Try this:
wchar_t* w = L"Insert into t (f1,f2) values ('\u4e01 ','AAA')"; WideString wS = WideString(w); //Set this char again, it seems to be \x01 here. //Set breakpoint and see actual value. May be it will be correct for you. //Also \u014e seems to be chinese, instead of \u4e01. wS[32] = '\u014e'; ADOCommand1->CommandText = wS; ADOCommand1->Execute(); And set ADOCommand1->ParamCheck = false, when parsing parameters VCL converts command text to AnsiString. //------------------------------------------ Regards, Vassiliev V. V. www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Bernd Muent" < XXXX@XXXXX.COM >???????/???????? ? ???????? ?????????: QuoteViatcheslav V. Vassiliev schrieb: |
Bernd Muent
![]() CBuilder Developer |
2005-05-02 03:19:11 PM
Re:ADO with unicode querys...
Viatcheslav V. Vassiliev schrieb:
QuoteAnd set ADOCommand1->ParamCheck = false, when parsing parameters VCL |