Btrieve Error 8020 using Delphi 2010 and PDAC V11 (for Pervasive V11)

Posted on 2011-04-20
Last Modified: 2012-05-11
I recently purchased Delphi 2010 (actually purchase RAD Studio XE, but downloaded 2010 as well) so that I could use the newest PDAC from Pervasive to update my applications that I've written in Delphi 7 to connect to the Pervasive SQL Engine version 11.

I keep getting this Btrieve Error 8020, when I try to access the tables (after placing the PvSession component and PvTable on a form).  

I've tried completely uninstalling the old Pervasive Client and PDAC (version 9.5) and re-installing the Client and PDAC for PSQL v11, and it still does not work.  However, I can use the TPvSQLSession and TPvQuery components successfully, as well as the Pervasive Control Center (PCC) without problems.

The PSQL Engine v11 is running on a fully patched Microsoft Server 2008 R2, Dell PowerEdge T710 with 48GB Ram, Intel Xeon CPU Quad Core E5620 Processor, 64bit computer.  The workstation is a Dell Precision T7400, with 2GB Ram, Intel Xeon X5450 processor, running fully patched Windows XP Pro Service Pack 3, with the Pervasive Client v11 (32bit) installed.

Any help would be greatly appreciated, as I cannot build all of my existing applications to work with the new server, until I get over this hurdle.  And of course Pervasive wants another arm and leg to help me.  I guess it doesn't matter that I've already spent over $5800 for the PSQL V11 Engine.....because they want to charge another $1000 for this one incident...go figure.

Question by:answerfreak
    LVL 22

    Expert Comment

    Does Pervasive provide any text along with the BTrieve Error 8020?

    Author Comment

    One more thing.... I have actually been able to connect to this new server using my applications written in Delphi 7 using the PDAC v9.5 with the PSQL client for v9.5, but thought that I of course should upgrade the client and PDAC (would have to to get them to work on Windows 7 (& Vista, yuck!)).  I also thought that using the correct client was not only vital, but that the applications would run much faster based on the articles I've read about PSQL v11......
    LVL 22

    Expert Comment

    See if this link provides some information:

    Pervasive Btrieve Error 8020

    Author Comment

    @ 8080 Diver:

    Within Delphi 2010, the full text of the error reads, "(Btrieve Error 8020). Cannot name the component."

    And if I click the "Details" button, I get the following:

    [0D95916A]{pb200r2010.bpl} Btvtables.TPvSession.CheckWithOwner + $32
    [0D95BC33]{pb200r2010.bpl} Btvtables.TPvDatabase.Check + $1B
    [0D95C0CA]{pb200r2010.bpl} Btvtables.TPvDatabase.DoConnect + $40A
    [5067F09D]{dbrtl140.bpl} DB.TCustomConnection.SetConnected (Line 3158, "DB.pas" + 8) + $4
    [5067F058]{dbrtl140.bpl} DB.TCustomConnection.Open (Line 3141, "DB.pas" + 0) + $4
    [5760D928]{pc200r2010.bpl} Pvtables.TPvAbsSession.DoOpenDatabase + $90
    [57614DC0]{pc200r2010.bpl} Pvtables.TPvDataSet.OpenDatabase + $48
    [57614B77]{pc200r2010.bpl} Pvtables.TPvDataSet.GetDatabase + $3B
    [0D963C31]{pb200r2010.bpl} Btvtables.TPvDrmDataSet.GetDatabase + $5
    [57502FE7]{pb200d2010.bpl} @ + $567
    [20EC4B8F]{vclide140.bpl} IDEInspListBox.TInspListBox.ListDropDown (Line 1276, "IDEInspListBox.pas" + 9) + $12
    [20EBAC6C]{vclide140.bpl} IDEListBtns.TListButton.DropDown (Line 674, "IDEListBtns.pas" + 5) + $A
    [20EBA6DA]{vclide140.bpl} IDEListBtns.TListButton.DefaultHandler (Line 494, "IDEListBtns.pas" + 13) + $4
    [20EBA76E]{vclide140.bpl} IDEListBtns.TListButton.WMLButtonDown (Line 527, "IDEListBtns.pas" + 7) + $2
    [5000A187]{rtl140.bpl  } System.TObject.Dispatch (Line 10010, "System.pas" + 8) + $0
    [50295E70]{vcl140.bpl  } Controls.TControl.WndProc (Line 7062, "Controls.pas" + 91) + $6
    [5029A738]{vcl140.bpl  } Controls.TWinControl.WndProc (Line 9819, "Controls.pas" + 144) + $6
    [502A2FC8]{vcl140.bpl  } Controls.TDockTree.WndProc (Line 15250, "Controls.pas" + 74) + $5
    [50064A43]{rtl140.bpl  } Classes.TThreadList.LockList (Line 3836, "Classes.pas" + 1) + $4
    [501D2A86]{vcl140.bpl  } Graphics.FreeMemoryContexts (Line 6935, "Graphics.pas" + 12) + $F
    [5029A018]{vcl140.bpl  } Controls.TWinControl.IsControlMouseMsg (Line 9604, "Controls.pas" + 9) + $25
    [5029A738]{vcl140.bpl  } Controls.TWinControl.WndProc (Line 9819, "Controls.pas" + 144) + $6
    [50299DD8]{vcl140.bpl  } Controls.TWinControl.MainWndProc (Line 9540, "Controls.pas" + 3) + $6
    [50076408]{rtl140.bpl  } Classes.StdWndProc (Line 13015, "Classes.pas" + 8) + $0
    [502C9921]{vcl140.bpl  } Forms.TApplication.StopHintTimer (Line 10491, "Forms.pas" + 3) + $6
    [502C8775]{vcl140.bpl  } Forms.TApplication.ProcessMessage (Line 9760, "Forms.pas" + 30) + $1
    [502C87BA]{vcl140.bpl  } Forms.TApplication.HandleMessage (Line 9790, "Forms.pas" + 1) + $4
    [502C8AE5]{vcl140.bpl  } Forms.TApplication.Run (Line 9927, "Forms.pas" + 26) + $3
    [004369AE]{bds.exe     } bds.bds (Line 200, "" + 8) + $FFFB

    Open in new window

    LVL 22

    Expert Comment

    Re: msg 35434100
    I would have the same thoughts.  Unfortunately, from the experience I have had with Pervasive, I might also be tempted to take a pragmatic approach and see if the PDAC v9.5 might not work with D2010. :-/

    I might also be looking into moving off of the Pervasive database (although I realize that you now have a significant investment in it) onto something like SQL Server Express or, possible, even SQL Server Standard Edition.  My encounter with Pervasive's Btrieve was a while back (probably about the same time as your D7 app and its interaction with Btrieve) but, after some significant difficulties with both upgrading the Btrieve version and then trying to work with it, the project lead decided to move off of Btrieve onto another database (and that database was not nearly as good as SQL Server Express ;-).
    LVL 18

    Expert Comment

    To use Delphi 2010 with PSQL and PDAC (PvTable), you have to use PSQL v11.  Older engines / PDAC / clients won't work.
    The 8020 is a missing component error.  Usually it's caused when an PSQL DLL can't be found.  

    You said you installed the v11 client.  DId you also download the latest PDAC from the Pervasive site?  With PSQL v10 and later, the client only includes the runtime components of PDAC.  You would need the SDK file to get the designtime components.  

    Make sure you are setting the database name and server name correctly in the PvSession and that the table name and session name are correct in the PvTable before setting PvTable.Active to true.  

    Also, check the PVSW.LOG to see if there's any indication which component is missing.  
    LVL 28

    Accepted Solution

    A few things:
    1) Pervasive offers free support within the first 30 days after purchase, so you should be able to leverage this.
    2) Even after 30 days, they offer support incidents for $250, if memory serves.  Not sure where you are getting the $1000 quote from.  
    3) As for the 8020, this is most commonly caused by leaving "old" components lying around.  Search your entire system (both the client and all mapped drives that might be in your application search path) for the following files:
    You should find ONE of each of these files (except for BIF, which is gone), and it should be in the C:\Program Files(x86)\Pervasive Software\PSQL\BIN folder.

    If you find any OTHER copies of these files, especially files that are much older than your current version (from the aforementioned folder), then rename them.  I'm betting that you have some leftovers from the PSQLV8 or older days -- probably an older WBTRV32.DLL file if I had to guess.  Once these files have been cleaned up, then you should find that the 8020 has gone away.

    Author Comment

    Re: msg ID: 35434164

    Well I did consider moving away from Pervasive, but it would be difficult as we also have a legacy system called Dataflex that we still use in our company.  I'm trying to write it away as quickly as possible but it will take some time.  And I really like Pervasive as a DB.  It's very fast, and compact, and easy to move around from server to server.  I've tried other databases, and while Microsoft SQL is very reliable, scalable and just as fast, I really liked having the VCL components written specifically for the database (Pervasive) for development in Delphi and didn't want to have another layer (ODBC) to add to the applications.

    Author Comment

    Re: msg ID: 35434228


    I'm searching for those files now.

    The $1000 for support was for 5 inicidents and was quoted yesterday.  I purchased PSQL V11 in December, but couldn't do anything because I had to wait almost 2-1/2 months to receive a Dell Server that I'd ordered that was delivered damaged twice.  So my 30 days has already pasted, unfortunately, and Pervasive won't budge on that.

    I'll try your suggestion.....


    I did indeed install the latest PDAC from Pervasive as well as the latest client V11 patch on top of the V11 client.  The PVSW.log only is logging actions that are taken when I use the PCC, but not on this specific problem, unfortunately.

    I'll keep trying all suggestions, and report back ASAP.  Thanks!

    Author Closing Comment

    I did everything that you stated, and I ended up contacting Pervasive support again.  This time, I was quoted one incident support at $250, just like you stated, and after three days of support from Pervasive, the culprit was finally revealed.  It was the DRM.DLL file that was causing issues, and it for some reason or another, would keep returning into the Windows/System32 directory.  But once deleted, all is well.


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now