Delphi Prism XE TAdoDBXDataReader Firebird UTF8 to ASP.NET string

Hello,
Im using Delphi Prism XE with ASP.NET and the component TAdoDBXDataReader to connect the Firebird database with UTF8 varchar coding. But there is a problem, because i cannot get correct coded string to ASP.NET application a back my Firebird database. I have tried to use Encoding.UTF8.GetString but I need to have Item in Bytes (Array of Byte), when i have tried to get it as String and convert it from UTF8 to UTF16 so it was wrong. When I have used Delphi .NET and TDBXReader like this example UTF8decode(dbR
eader.Value['CDESC'].GetAnsiString) it worked fine. Please help me how to do it.

Best Regards
Rudolfino
0
Rudolf
10/19/2010 8:30:18 AM
embarcadero.delphi.database 1294 articles. 0 followers. Follow

5 Replies
1142 Views

Similar Articles

[PageSpeed] 29

> {quote:title=Rudolf Touzin wrote:}{quote}
> Hello,
> Im using Delphi Prism XE with ASP.NET and the component TAdoDBXDataReader to connect the Firebird database with UTF8 varchar coding. But there is a problem, because i cannot get correct coded string to ASP.NET application a back my Firebird database. I have tried to use Encoding.UTF8.GetString but I need to have Item in Bytes (Array of Byte), when i have tried to get it as String and convert it from UTF8 to UTF16 so it was wrong. When I have used Delphi .NET and TDBXReader like this example UTF8decode(d
bReader.Value['CDESC'].GetAnsiString) it worked fine. Is possible change default unicode (utf-16) to UTF-8 for AdoDBX components ?


> Best Regards
> Rudolfin
0
Rudolf
10/21/2010 8:15:23 AM
> {quote:title=Rudolf Touzin wrote:}{quote}
> Hello,
> Im using Delphi Prism XE with ASP.NET and the component TAdoDBXDataReader to connect the Firebird database with UTF8 varchar coding. But there is a problem, because i cannot get correct coded string to ASP.NET application a back my Firebird database. I have tried to use Encoding.UTF8.GetString but I need to have Item in Bytes (Array of Byte), when i have tried to get it as String and convert it from UTF8 to UTF16 so it was wrong. When I have used Delphi .NET and TDBXReader like this example UTF8decode(d
bReader.Value['CDESC'].GetAnsiString) it worked fine. Please help me how to do it.
> 
> Best Regards
> Rudolfino

There is possibility with standard DBX component TSQLConnection to add params servercharset and change standard chartset to other one, but I dont know how to set on TAdoDbxConnection. I have tried add parameter servercharset=UTF-8 to ConnectionString but without any effect.

Rudolfino
0
Rudolf
10/21/2010 12:05:00 PM
> {quote:title=Rudolf Touzin wrote:}{quote}
> Hello,
> Im using Delphi Prism XE with ASP.NET and the component TAdoDBXDataReader to connect the Firebird database with UTF8 varchar coding. But there is a problem, because i cannot get correct coded string to ASP.NET application a back my Firebird database. I have tried to use Encoding.UTF8.GetString but I need to have Item in Bytes (Array of Byte), when i have tried to get it as String and convert it from UTF8 to UTF16 so it was wrong. When I have used Delphi .NET and TDBXReader like this example UTF8decode(d
bReader.Value['CDESC'].GetAnsiString) it worked fine. Please help me how to do it.
> 
> Best Regards
> Rudolfino

I tried to get data from TAdoDBXDataReader as array of chars by function GetChars.

The function definition is : function GetChars(Ordinal: Integer; DataOffset: Int64; Bytes: array of char; BufferOffset: Integer; Length: Integer): Int64; override;.

In my case it looks like : lenRead:=dbReader.GetChars(dbReader.GetOrdinal('CDESC'),0,myChars,0,100); - where lenRead:int64; and myChars:Array of Char;,
but I got next error: Exception Details: Borland.Data.TAdoDbxException: Invalid field type:  Int64

Does anybody where is the problem ? 

Rudolfino
0
Rudolf
10/22/2010 12:22:24 PM
> {quote:title=Rudolf Touzin wrote:}{quote}
> Hello,
> Im using Delphi Prism XE with ASP.NET 

You should post Prism questions in the Delphi Prism forums. There are significant differences between Delphi and Prism, and between using .NET data controls and Delphi's own. Posting in the proper groups will improve your chances of getting a quick (and correct) answer.

You can start here: https://forums.embarcadero.com/category.jspa?categoryID=51 There are a couple of DB related forums that may help.
0
Ken
10/22/2010 1:19:20 PM
> {quote:title=Rudolf Touzin wrote:}{quote}
> Hello,
> Im using Delphi Prism XE with ASP.NET and the component TAdoDBXDataReader to connect the Firebird database with UTF8 varchar coding. 


I solved this problem by using Firebird.ADO.NET provider instead AdoDBX components and it works well.

Best regards Rudolfino
0
Rudolf
10/25/2010 7:51:56 AM
Reply:

Similar Artilces:

Any difference between Delphi Prism 2011 and Delphi Prism XE?
Looking at the features in Delphi Prism XE, they look the same as the new items in the 2011 release back in may. I there anything new in the XE release? or did they simply change the product branding? Just wondering if I need to update it or now when i download the rest. Thanks, Hi Dan, > Looking at the features in Delphi Prism XE, they look the same as the new items in the 2011 release back in may. I there anything new in the XE release? or did they simply change the product branding? Just wondering if I need to update it or now when i download the rest. See http://w...

Converting Delphi for Win32 to Delphi .Net(Prism)
Hi, I am currently migrating a project from Delphi for Win32 to Delphi.net. Part of my code currently goes into a directory and pulls out a random file from this directory and loads the contents of the file for me. This code doesn't seem to work in Delphi.Net. It uses PString and a number of functions in SysUtils that don't seem to be present in Delphi.net's SysUtils file. If anyone can help me please, it would be greatly appreciated! Many thanks, Jonathan Mackey Jonathan Mackey a écrit : > I am currently migrating a project from Delphi for Win32 to &...

Delphi and Delphi for .Net
It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. I would like to know is it true all .Net application is slower than Win32 native applicaiton or it is Delphi for .Net only. Your information is great appreciated, Inung On 2011-06-21 18:20:17 +0100, Inung Huang said: > It seems that Delphi for .Net is slower than Delphi Win32 native applicaiton. > I would like to know is it true all .Net application is slower than > Win32 native applicaiton or it is Delphi for .Net only. If you are only running the code in the application once then, yes, yo...

Delphi 5 (string[80]) vs Delphi XE
Hi guys i'm trying to convert a old application made with Delphi 5 to Delphi XE 5 The probleme i have right now is about String[80] and the Read / Write procedure i have a type like that Type TEnrMess = record Mess : String[80]; MessSuiv : Word; Hint : Word; end; And i read/write this type to a File of TEnrMess My probleme is that the string have changed from Delphi 5 to Delphi XE i join the link of a simple of the probleme that can be compiled on delphi 5 and any Delphi XE https://mega.co.nz/#!wV1VyZzY!1ha5oOxTg7L1WJAOXutUygkj...

Is there a Delphi prism asp.net group ?
I finally was able to buy my copy of Prism Professional in India(a very daunting task) Is there a Delphi Prism asp.net group Venkatesh (my name does not show up correctly in the sender column) thomas hamburger wrote: > (my name does not show up correctly in the sender column) Change your name here: https://members.codegear.com/editaccount.aspx. Once you change that, your name will appear correctly. Jon Jonathan Benedicto wrote: > thomas hamburger wrote: >> (my name does not show up correctly in the sender column) > > Change your name here: https://membe...

Delphi Prism ASP.NET Errors
I have a large web app I am moving from Delphi2007. I randomly receive the following error repeated HUNDREDS of times during the build: Error 4 (CE73) Type "__Global" used is defined in multiple assemblies (App_Web_unwk1eeo, App_Web_zy34yb0j) Sometimes the build completes and I recieve a similar error as the app/web page loads. If I exclude some modules randomly (different ones each time), I can normally get it to build. Then, if I put those back, and just press Build (not Rebuild), it continues to work - until randomly it stops working. If I press "Rebuild&quo...

Connection String for ADO Database in delphi prism
Hi, I want to connect to a database with ADO and aspx. from VB code what is the equivalent in delphi prism ? .... Dim MyReader as sqldatareader Dim MyConnection as sqlconnection = new sqlconnection() myConnection.connectionstring = configurationmanager.connectionstrings("DSN_MYDB").connectionstring Dim mycommand as sqlcommand = new sqlcommand() mycommand.commandtext="select * from mytable" mycommand.commandtype = commandtype.text mycommand.connection = myconnection mycommand.connection.open() Myreader=mycommand.executereader(commandbehavior.closeconnec...

How to create an ASP.NET site with delphi prism
Hello, i have installed delphi Prism. I also have installed VS2008 before install DPrism. I can create new projects selecting Delphi Prism as language, but when i try to create a Web Site selecting Delphi Prism as language, all controls are disabled except the cancel button. Thanks Jesus Garcia wrote: > Hello, i have installed delphi Prism. I also have installed VS2008 > before install DPrism. I can create new projects selecting Delphi > Prism as language, but when i try to create a Web Site selecting > Delphi Prism as language, all controls are disabled except the ca...

Delphi for PHP or Delphi PRISM
Hi, I have the opportunity to develop a web-based library management system. Nothing fancy, just being able to do the usual CRUD stuff for books and provide a search facility. Borrowing is to be done via an email request to the library admin who then sends out the book(s). Since both Delphi for PHP and Delphi PRISM will enable me to develop the app, which one will allow me to deliver it in less time and also increase (even how small) my marketability as a web developer? Thanks. Phillip Flores Phillip Flores wrote: > Hi, > > I have the opportunity to develop a...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

TDBXError malformed string (Delphi 2010, Firebird, UTF8)
Currently doing some tests with Delphi 2010 trial and firebird with the express driver from http://groups.google.com/group/dbxfirebird/ I ran into the following problem at first : I had a username and a password that is encrypted from inside my applicatio with AES. Encrypting, decrypting works fine. The moment i sent it to the database it got screwed up since it was not in UTF8. I created a new database UTF8, problem fixed. But the next problem came up. Whenever i try to save an empty string into a field i get TDBXError malformed string. When there is 1 character in my string everyt...

Delphi Prism and ASP.NET MVC project templates
Hello. I have studied ASP.NET MVC lately for developing web applications with Delphi Prism. Are there plans to supply the same project templates for Oxygene as for C#? For the moment I'm using the template from the CodeRage presentation and C# templates. But it would be nice with updated Oxygene templates. -Bjarte Bjarte K. Vebjørnsen wrote: > Are there plans to supply the same project templates for Oxygene as > for C#? Yes, there sure is. -- Nick Hodges Delphi Product Manager - Embarcadero http://blogs.codegear.com/nickhodges > {quote:title=Nick ...

Delphi and Delphi Prism licensing question
When I buy Delphi and Delphi Prism, do I get a "named user licence" or a "workstation licence"? Can I install both products on two machines I use with the same licence keys? I have a Mac Pro ("Cyrus") running Vista 64 in VMware and a MacBook ("Blacky") running Vista 32 in Parallels. Can I install Delphi and Delphi Prism on both Cyrus and Blacky since I use both machines (and like to have all dev tools I use installed on both machines at all times)? Andrew Brehm wrote: > When I buy Delphi and Delphi Prism, do I get a "named user licence...

Web resources about - Delphi Prism XE TAdoDBXDataReader Firebird UTF8 to ASP.NET string - embarcadero.delphi.database

Resources last updated: 11/25/2015 7:40:40 PM