BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inserting unicode string into database using ADO(dbGo)

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization
View previous topic :: View next topic  
Author Message
Sabecki
Guest





PostPosted: Wed Nov 23, 2005 4:19 pm    Post subject: Inserting unicode string into database using ADO(dbGo) Reply with quote



Hello

I have a problem which I have been fighting with for a couple of days,
but I haven't solve it yet. I was looking on Google, but didn't find
solution. Everything seems to be OK, but it's not working.

I use Delphi2005, Oracle 9i database, dbGo(ADO) components and Oracle
Provider for OLE DB. My project is Delphi for .NET. In database I have
a table with column of type NVARCHAR2, where I store Unicode chars.
Records are shown in TDBGrid and everything is correct, there is
unicode.

The problem begins with insert operation. I use TADOQuery linked with
TADOConnection. SQL command is 'insert into uni_test(ntext)
values(:ntext)'. Parameter 'ntext' is created. I assign it with unicode
string from TEdit:

var ws : WideString;
v : Variant;

ws := Edit3.Text;
v := ws;

ADOQuery1.Parameters.ParamByName('ntext').Value := v;
ADOQuery1.Parameters.ParamByName('ntext').DataType := ftWideString;

It is all correct now, even if I try:

ws := ADOQuery1.Parameters.ParamByName('ntext').Value;
ShowMessage(ws);

there is unicode string shown, if I try:
ADOQuery1.ExecSQL();
only question marks(?????) are written to database.


What's the problem?
I have to mention, that:
- Delphi2005 controls show unicode strings
- in database there are unicode strings for sure, cuz I can show them
- ADOQuery parameter(Variant) before execution is also unicode
- to show and insert operations I use the same TADOConnection component

For me it looks like there is a switch like "useUnicode = true" or sth
which should be on, but I can't find nothing appropriate.


Help me, please!!!
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.