We're using the latest version of D2010 and DbxOda v.4.50.21.
Because of an issue with have with consistency between the DbxSda & DbxOda drivers, we need to turn Unicode off. I've set the driver options in the Ini file to UseUnicode=False and UnicodeEnvironment=False.
The first time you make a connection, it works fine. If you set SqlConnection1.Connected = false, then back to true, it raises the error 'UseUnicode option must be set to True for Unicode OCI environment'.
I saw the Extended Driver Options in the Readme.html file, from how I interpret the info there, because we're using D2010 I don't have to do the SQLConnection.SetOption in the AfterOpen, it's ok to just set Params.Value[UnicodeEnvironment'] := 'False';
Do I have this correct? If so, why would it connect fine the first time, but a subsequent disconnect and connect causes the error to occur?
Any help or insight you might have would be greatly appreciated,
- Rich Werning
D2010: UseUnicode option must be set to True ...
Hello,
This problem is connected with the fact that the global OraCall.OCIUnicode (UnicodeEnvironment) variable is initialized only at the first connect and if it is set to true you can't set the UseUnicode option to false.
To resolve the problem, you should set the UnicodeEnvironment option to false before the first connect.
We will consider the possibility to change such behavior.
This problem is connected with the fact that the global OraCall.OCIUnicode (UnicodeEnvironment) variable is initialized only at the first connect and if it is set to true you can't set the UseUnicode option to false.
To resolve the problem, you should set the UnicodeEnvironment option to false before the first connect.
We will consider the possibility to change such behavior.
Hello,
Please check that you really set the UnicodeEnvironment and UseUnicode options to false before first connect, for example, in the following way:
procedure TForm1.SQLConnection1BeforeConnect(Sender: TObject);
begin
ShowMessage('UseUnicode: '+SQLConnection1.Params.Values['UseUnicode']);
ShowMessage('UnicodeEnvironment: '+SQLConnection1.Params.Values['UnicodeEnvironment']);
end;
Please check that you really set the UnicodeEnvironment and UseUnicode options to false before first connect, for example, in the following way:
procedure TForm1.SQLConnection1BeforeConnect(Sender: TObject);
begin
ShowMessage('UseUnicode: '+SQLConnection1.Params.Values['UseUnicode']);
ShowMessage('UnicodeEnvironment: '+SQLConnection1.Params.Values['UnicodeEnvironment']);
end;
I made a test case using just a sqlconnection, and setting all the params in a button click event, it seems to work fine - just as you described.
Somewhere along the code path the params are getting messed with. It's odd.. it is being set, but it isn't.. If I run our app and evaluate the params in debugger they show ok, but if I use the showmessage after connect the params don't contain a value, however I can evaluate them and they have one.
I'll research more.. if there's anything more interesting than some stupid coding error I'll follow up with more details.
Thanks again for your help.
Somewhere along the code path the params are getting messed with. It's odd.. it is being set, but it isn't.. If I run our app and evaluate the params in debugger they show ok, but if I use the showmessage after connect the params don't contain a value, however I can evaluate them and they have one.
I'll research more.. if there's anything more interesting than some stupid coding error I'll follow up with more details.
Thanks again for your help.