Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Access Violation Delphi XE7 using IBSQL or IB


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Nov 10, 2014 12:04 PM Last Post By: Dan Palley
Dan Palley

Posts: 43
Registered: 2/14/00
Access Violation Delphi XE7 using IBSQL or IB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 10:48 AM
Hi, I'm getting an access violation opening a TIBSQL or TIBQuery after upgrading my project to XE 7. The error is being raised in procedure TIBSQL.Prepare and is happening on the following line:

bt := Database.Encoding.GetBytes(FProcessedSQL.Text + #0);

I'm guessing there's a new property added to one of the IBX components that's not being set.

Any ideas?

Thanks,

Dan Palley
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Access Violation Delphi XE7 using IBSQL or IB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 11:01 AM   in response to: Dan Palley in response to: Dan Palley
Dan Palley wrote:
Hi, I'm getting an access violation opening a TIBSQL or TIBQuery after upgrading my project to XE 7. The error is being raised in procedure TIBSQL.Prepare and is happening on the following line:

bt := Database.Encoding.GetBytes(FProcessedSQL.Text + #0);

I'm guessing there's a new property added to one of the IBX components that's not being set.

Any ideas?

Thanks,

Dan Palley

What is the value of FProcessedSQL.Text. Also what version are you coming from?
This code really hasn't changed since the Unicode stuff was back in D2009 (?).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)
Dan Palley

Posts: 43
Registered: 2/14/00
Re: Access Violation Delphi XE7 using IBSQL or IB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 11:05 AM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Hi Jeff,

I think I found the issue. It looks like setting the encoding moved from the Prepare method to the Connect method in XE 7. I'm not using Connect since I'm sharing a database handle that's opened using FireDAC, so I'm calling SetHandle instead, which doesn't seem to set the encoding.

Dan

What is the value of FProcessedSQL.Text. Also what version are you coming from?
This code really hasn't changed since the Unicode stuff was back in D2009 (?).

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)
Jeff Overcash (...

Posts: 1,529
Registered: 9/23/99
Re: Access Violation Delphi XE7 using IBSQL or IB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 11:23 AM   in response to: Dan Palley in response to: Dan Palley
Dan Palley wrote:
Hi Jeff,

I think I found the issue. It looks like setting the encoding moved from the Prepare method to the Connect method in XE 7. I'm not using Connect since I'm sharing a database handle that's opened using FireDAC, so I'm calling SetHandle instead, which doesn't seem to set the encoding.

Dan

Yes this was a performance enhancement to not create/destroy the same encoding
over and over. Since it is based on the lc_ctype at connect time it is created
only then and reused over and over. It is also, unfortunately for you, read only.

The Encoding is only destroyed when the IBDatabase is destroyed or when a new
connection is made so one workaround might be Connect with IBDatabase,
disconnect (should leave the correct encoding) then connect FireDAC and share
the handle.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)
Dan Palley

Posts: 43
Registered: 2/14/00
Re: Access Violation Delphi XE7 using IBSQL or IB  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 10, 2014 12:04 PM   in response to: Jeff Overcash (... in response to: Jeff Overcash (...
Jeff,

I'll give the work-around a try. For now, creating a separate connection works fine.

Thanks,

Dan

Jeff Overcash (TeamB) wrote:

Yes this was a performance enhancement to not create/destroy the same encoding
over and over. Since it is based on the lc_ctype at connect time it is created
only then and reused over and over. It is also, unfortunately for you, read only.

The Encoding is only destroyed when the IBDatabase is destroyed or when a new
connection is made so one workaround might be Connect with IBDatabase,
disconnect (should leave the correct encoding) then connect FireDAC and share
the handle.

--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted corridors of Whitehall.
(Fish)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02