Delphi XE Access violation in module 'dbxfb.dll'

Hi to all,

I'm testing dbExpress and some times I get an access violation with this code:

{code}
function TForm1.GetBlobText(id: Integer): String;
begin
    Result := '';
    if (id > 0) then
    try

        if not SQLConnection1.Connected then
            SQLConnection1.Connected := True;

        SQLQuery1.Close;
        SQLQuery1.Sql.Text :=
            Format('SELECT id, somefield, txt_field FROM my_table WHERE id = %d', [id]);
        SQLQuery1.Open;

        Result := SQLQuery1.FieldByName('txt_field').AsString;

    except
        raise;
    end;
end;
{code}

Firebird 1.5.6
fbclient.dll v.1.5.3.4870

What am I doing wrong? Any help will be appreciated.

Nando.
0
Hernando
10/4/2010 4:27:34 PM
embarcadero.delphi.dbexpress 764 articles. 0 followers. Follow

8 Replies
2220 Views

Similar Articles

[PageSpeed] 17
Get it on Google Play
Get it on Apple App Store

Hi Hernando,

> I'm testing dbExpress and some times I get an access violation with this code:

If the record cannot be found (for an unknown ID), then you cannot 
access the 'txt_field' field - that will give an access violation indeed.

So the question is: when you get an access violation, do you pass a 
valid ID? (and if you do, what's in the blob fields of the records that 
you get an access violation for?)

> Nando.

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Chairman Delphi Development Network (DDN) powered by SDN - www.sdn.nl
Embarcadero Technology Partner - Delphi & RAD Studio Reseller BeNeLux
http://twitter.com/eBob42 LinkedIn: http://nl.linkedin.com/in/drbob42
Delphi Win32 & .NET books on Lulu.com: http://stores.lulu.com/drbob42
Personal courseware + e-mail support http://www.ebob42.com/courseware
Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
0
Bob
10/4/2010 5:14:31 PM
> {quote:title=Bob Swart wrote:}{quote}
> Hi Hernando,
> 
> > I'm testing dbExpress and some times I get an access violation with this code:
> 
> If the record cannot be found (for an unknown ID), then you cannot 
> access the 'txt_field' field - that will give an access violation indeed.

No. This is not the case. If the record is not found due to an unknown ID, the 'txt_field' result is '' and there is no access violation exception.

> So the question is: when you get an access violation, do you pass a 
> valid ID?

All the times the access violation raises is with a valid ID.

> (and if you do, what's in the blob fields of the records that 
> you get an access violation for?)

I can't tell what is in the blob fields because, as found debugging line by line, the exception occurs just on the "Result := SQLQuery1.FieldByName('txt_field').AsString;".

I've noticed that it is more likely to occur when the application just starts running. If you want to, I can send you the project and the SQL srcrip for creating and populating the table needed to reproducing the error.

> > Nando.
> 
> Groetjes,
>            Bob Swart
> 
> -- 
> Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
> Chairman Delphi Development Network (DDN) powered by SDN - www.sdn.nl
> Embarcadero Technology Partner - Delphi & RAD Studio Reseller BeNeLux
> http://twitter.com/eBob42 LinkedIn: http://nl.linkedin.com/in/drbob42
> Delphi Win32 & .NET books on Lulu.com: http://stores.lulu.com/drbob42
> Personal courseware + e-mail support http://www.ebob42.com/courseware
> Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
0
Hernando
10/4/2010 6:04:19 PM
Hi Hernando,

>> So the question is: when you get an access violation, do you pass a
>> valid ID?
>
> All the times the access violation raises is with a valid ID.

OK, then it may be the contents of the blob field...

>> (and if you do, what's in the blob fields of the records that
>> you get an access violation for?)
>
> I can't tell what is in the blob fields because, as found debugging line by line, the exception occurs just on the "Result := SQLQuery1.FieldByName('txt_field').AsString;".

OK, but is the access violation always happening with the same record(s) 
- or are you able to get the contents of a blob field at some time and 
get an access violation at other times? (I'm hoping that the access 
violation is always happening for certain records, and that the cause 
can be found inside the blob field, for example when it's a binary 
fields with lots of #0 inside or other problems).

> If you want to, I can send you the project and the SQL srcrip for creating and populating the table needed to reproducing the error.

I'm sorry, but I don't have Firebird on my machine. Maybe someone else 
wants to?

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Chairman Delphi Development Network (DDN) powered by SDN - www.sdn.nl
Embarcadero Technology Partner - Delphi & RAD Studio Reseller BeNeLux
http://twitter.com/eBob42 LinkedIn: http://nl.linkedin.com/in/drbob42
Delphi Win32 & .NET books on Lulu.com: http://stores.lulu.com/drbob42
Personal courseware + e-mail support http://www.ebob42.com/courseware
Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
0
Bob
10/4/2010 6:29:27 PM
Hi, Bob

Thank you for your posts.

> - or are you able to get the contents of a blob field at some time and 
> get an access violation at other times?

Yes. Some times I'm able to get the contents of the blob field in one such record that previously raised the accesss violation.

> ... and that the cause 
> can be found inside the blob field, for example when it's a binary 
> fields with lots of #0 inside or other problems).

I don't think so. It could happen with short blob fields (less than 100 chars) whith just plain ASCII text content.

Nando.
0
Hernando
10/4/2010 7:06:22 PM
Hernando Duque wrote:

> Hi, Bob
> 
> Thank you for your posts.
> 
> > - or are you able to get the contents of a blob field at some time
> > and get an access violation at other times?
> 
> Yes. Some times I'm able to get the contents of the blob field in one
> such record that previously raised the accesss violation.
> 
> > ... and that the cause 
> > can be found inside the blob field, for example when it's a binary 
> > fields with lots of #0 inside or other problems).
> 
> I don't think so. It could happen with short blob fields (less than
> 100 chars) whith just plain ASCII text content.
> 
> Nando.


Something different, but maybe can help you narrow the situation. I
know for sure that in Delphi 2007 and Informix server whenever the
length of the blob field is 0 and the value is not null the driver will
raise an exception.

You should search for a pattern when this happens to you.
0
Lajos
10/4/2010 9:26:08 PM
Bob, thank you anyway for your help.

> Something different, but maybe can help you narrow the situation. I
> know for sure that in Delphi 2007 and Informix server whenever the
> length of the blob field is 0 and the value is not null the driver will
> raise an exception.
> 
> You should search for a pattern when this happens to you.

After doing more tests without finding a pattern. I decided make tests with a different DBX driver, the dbxup_fb30.dll. With this driver definitely does not happen any access violation exception. So I do believe that there is some kind of bug in dbxfb.dll. If there were a wrong record in the dataset the driver should announce it in different way than making an acces violation.

Nando.
0
Hernando
10/5/2010 5:53:49 PM
Hi Hernando,

> I decided make tests with a different DBX driver, the dbxup_fb30.dll. With this driver definitely does not happen any access violation exception. So I do believe that there is some kind of bug in dbxfb.dll. If there were a wrong record in the dataset the driver should announce it in different way than making an acces violation.

Where does the dbxup_fb30.dll driver come from?

If you have a small Firebird database, one table, a few records, and a 
small project to demonstrate the problem (one form, one button), the I 
suggest you upload it to Quality Central and file a bug report to have 
it reproduced by the Delphi Team and hopefully fixed in a future update.

> Nando.

Groetjes,
           Bob Swart

-- 
Bob Swart Training & Consultancy (eBob42.com) Forever Loyal to Delphi
Chairman Delphi Development Network (DDN) powered by SDN - www.sdn.nl
Embarcadero Technology Partner - Delphi & RAD Studio Reseller BeNeLux
http://twitter.com/eBob42 LinkedIn: http://nl.linkedin.com/in/drbob42
Delphi Win32 & .NET books on Lulu.com: http://stores.lulu.com/drbob42
Personal courseware + e-mail support http://www.ebob42.com/courseware
Blog: http://www.drbob42.com/blog - RSS: http://eBob42.com/weblog.xml
0
Bob
10/5/2010 8:13:00 PM
Hi Bob,

> Where does the dbxup_fb30.dll driver come from?

http://www.upscene.com/products.dbx.dbx_fb.php
 
> If you have a small Firebird database, one table, a few records, and a 
> small project to demonstrate the problem (one form, one button), the I 
> suggest you upload it to Quality Central and file a bug report to have 
> it reproduced by the Delphi Team and hopefully fixed in a future update.

Yes, I do. I'll do what you tell.

Thank you.

Nando
0
Hernando
10/5/2010 11:32:43 PM
Reply:

Similar Artilces:

Delphi XE Access violation in module 'dbxfb.dll' #2
Hi to all. I'm forced to migrate a Delphi 2007 application to Delphi XE using DbExpress and the dbxfb.dll driver. I had to make a trick for loading Blob fields into a TRichEdit. I got enforced to write this code: {code} procedure TForm1.LoadMemo(id: Integer); var I: Integer; strText: AnsiString; myStream: TMemoryStream; begin SQLQuery1.Close; SQLQuery1.Sql.Text := 'SELECT id, txt_field FROM my_table WHERE id = ' + IntToStr(id); SQLQuery1.Open; strText := SQLQuery1.FieldByName('txt_field').AsString; myStream := TMemoryStream...

Delphi XE Access Violation in 'vclide150.bpl', Read of address 00000048
Been using Delphi XE (part of RAD Studio) for a few months on this machine with no problems. Earlier today, installed latest (December) MS updates for Windows XP but now starting Delphi, I get the following error: Access Violation at address 21280D98 in 'vclide150.bpl'. Read of address 00000048. Clicking OK lets Delphi continue to load but things are not in the right place on screen, particularly view of PAS files goes way below screen where they can't be seen. It's not possible to debug anything either. Clicking Details>> button gives: [21280D98]{vclide150.bpl...

Delphi XE 'import of DLL symbol by ordinal'
I am trying to compile a package that has some DLL calls to the shell32.dll. function SHShutDownDialog; external 'shell32.dll' index 60; function SHRunDialog; external 'shell32.dll' index 61; function SHChangeIconDialog; external 'shell32.dll' index 62; The compiler complains: " [DCC Error] ushldlg.pas(1): E1025 Unsupported language feature: 'import of DLL symbol by ordinal' " Apparently by index is not supported anymore. The problem is I checked the shell32.dll and those functions can only be referenced by index and not by name? Is t...

''''''''''''''''''''
Name: haznen Email: haznenatyahoodotcom Product: Gran Paradiso Alpha 8 Summary: '''''''''''''''''''' Comments: '''''''''''''''''''''''''''''''''''' Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061204 UGES/1.7.2.0 GranParadiso/3.0a1 From URL: http://www.mozilla.org/projects/granparadiso/ Note to readers: Hendrix gives...

'''''
Name: mario Email: ramar17atfastwebnetdotit Product: Gran Paradiso Alpha 2 Summary: ''''' Comments: K: Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a2) Gecko/20070206 GranParadiso/3.0a2 ...

C++ Replacement or similar keywords for 'is' and 'as' Delphi keys.
hello there, i am a newcomer to C++ Builder so excuse any mistake. My question is (maybe a stupid question) My first language is Delphi and i usually use this type of sentences: if Sender is TEdit then (Sender as TEdit).Text := ''; A replacement or similar keywords exist for C++ Builder? Thanks in advance. Am 27.09.2010 13:37, schrieb finneas finn: > A replacement or similar keywords exist for C++ Builder? TEdit * Edit; if ((Edit = dynamic_cast<TEdit*>(Sender)) != 0) { Edit->Text = ""; } Christian Il Mon, 27 Sep 2010 04:37:55 -0...

INSTALL 'freetyp6.dll' and 'fntcfg2.dll' i
Where can I download these as non yum/rum versions? TIA -- Regards Dave Saville On 03/10/15 11:08 AM, Dave Saville wrote: > Where can I download these as non yum/rum versions? > > TIA > http://rpm.netlabs.org/release/00/zip/ contains all the zip files that have been packaged as zip files. Don't forget about libpng-1_6_16-1_oc00.zip, urpo.dll which needs to be the latest and may have not been packaged and possibly z, bzip, and xv libraries, I haven't tried the newest but Bitwise seems to want to have as many dependencies as possible. Dave ps GCC1.d...

Error 43 The type 'Controls_XX' exists in both '..\App_Web_blah1.dll' and '..\App_Web_blah2.dll'
When I try to publish my website I keep getting these errors which relate to various conflicts present in subdirectories at c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ The problem always relates to a particulate User Control : 'Controls_PgHeader', which is just about the only control which is modified from one compilation to the next. Other than manually deleting the files which are in conflict, what is the solution and source of this problem? Here is a sample error message: Error 43 The type 'Controls_PgHeader' exists in bot...

new user question: Delphi equivalents to BP 'readkey' and 'keypress'
Hi All, Sorry if this is the wrong forum. In the documentations section I already asked for general advice, so let's keep that out to the extent practicable - you be the judge. Background: a relatively experienced Borland Pascal programmer for DOS and DPMI, PhD in math, trying to make a comeback to what once was a dear hobby (game programming) and in need of doing also some scientific programming. A retailer said that CodeGear Delphi is my best bet, so hear I am. Problem: As a first exercise for myself (trying to get the hang of the basics of the IDE) I took up a project of portin...

Access Violation at address ... in module 'vcl150.bpl'
Hi I occasionally (too many times) get this error when closing down. I also find the same in my Delphi 7 IDE which I keep for compatibility and support reasons. Any idea why this happens and what I could do to avoid this? I am using Windows 7 RAD Studio XE Regards Bennie Bennie Coetzer wrote: > Hi I occasionally (too many times) get this error when closing down. > I also find the same in my Delphi 7 IDE which I keep for > compatibility and support reasons. Any idea why this happens and > what I could do to avoid this? > > I am using > Windows 7 >...

Delphi XE Unknown driver 'Firebird' exception
Well... I have a Delphi 2007 application running fine since several years ago using dbExpress + dbxint30.dll with a Firebird 1.5 database. It uses a ini file that is read during application's bootstrap and configurates de TSQLConnection parameters before connecting to the database. Now I'm compiling the same application with Delphi XE using dbExpress + dbxfb.dll and the only difference is that in the ini file these parameters change to: DriverName=Firebird LibraryName=dbxfb.dll .... But I get a "Unknown driver Firebird" exception. I did test connecting from the ...

Delphi XE and 'classic' DataSnap (TLB/RIDL)
Hello, Does XE support creation of RIDL/TLB based DataSnap servers, with SocketServer middleware? I have not found a way to create a new DataSnap project with this 'classic' technology. -- Michael Justin ...

Problem: The type 'typename' exists in both 'dll-name-1' and 'dll-name-2'
Hi at all!For some strange reason I sometimes (not always) get the following compilation error when starting my ASP.net project:Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0433: The type 'ASP.formscontrols_worker_it_ascx' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0....

Occaisonal Build problems (type 'xxx' exists in both 'yyy.dll' and 'xxx.dll')?
Hello: Been working with Express for about 2 months now -- and it generally works fine -- but I occaisonally get this error message when I rebuild projects to rerun it: ------ Rebuild All started: Project: http://localhost/TestIV/, Configuration: Debug .NET ------ Build Web Beginning D:\DEV\DEV_NET\CS\SITES\TestIV\portal.aspx(9,31): error CS0433: The type 'ASP.Portal' exists in both 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\testiv\2bc5e680\fdf16dd9\f3iai7un.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\testiv\...

Web resources about - Delphi XE Access violation in module 'dbxfb.dll' - embarcadero.delphi.dbexpress

Resources last updated: 12/4/2015 5:16:44 AM