Solved

VB5 using Btrieve

Posted on 1997-09-25
7
664 Views
Last Modified: 2008-03-06
I receive an intermittent 'Invalid Page Fault' when accessing the Btrieve engine from a VB5 project.

I am using the 1996 version of the Btrieve WBTRV32.DLL

Funnily enough, the error doesn't just happen on the actual BtrCall calls, it often happens on an End Sub and various other places.

Changing the ByVal's in the actual call has an effect. However, I have not been able to find a combination that totally eliminates the problem.

The fault does not necessarily happen the first time the code is run. Sometimes it takes 12 runs for it to happen. Once it took 44 times.

Help !
0
Comment
Question by:TD092397
  • 5
  • 2
7 Comments
 
LVL 9

Expert Comment

by:cymbolic
ID: 1435839
What Access method are you using? RDO?  Are you using the Pervasive ODBC driver?  Is the Jet engine involved? Please tell me more about the configuration involved. thx!
0
 
LVL 9

Accepted Solution

by:
cymbolic earned 200 total points
ID: 1435840
There is a more recent version.  I recently updated to it from pervasive software, and it may solve your problem.  My version is dated 2/12/97 and it's 68,096 in size.  Betcha this fixes it! (nobody admits to problems anymore, they just make you buy an upgrade, and suddenly, the problem goes away!)
0
 

Author Comment

by:TD092397
ID: 1435841
Thanks.

Funnily enough our support manager tried it out yesterday afternoon and it didn't help. I've tried it as well. No go.

I'm not using RDO, ODBC or the Jet engine. I use a function declaration (BtrCall) and maintain all aspects of a particular file within a class instance.

To give you an idea:
The sample code that comes with the developers' kit works. Which peed me off no end ! So I changed it.
First I remmed the code that creates the file. Then I put the rest in a 0-100 loop (remember you have to run it a few times).
It ran fine.
Second I changed the data buffer being passed to a fixed-length string of len = 585 instead of a user-defined type. Crash !

Unfortunately, changing my class to use a user-defined type doesn't help.

By the way, my background: I have been using VB for 4 years and Btrieve for 3 months. Just to give you an idea on what level you would need to talk to me. (Also I'm really stupid).

Thanks
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Expert Comment

by:cymbolic
ID: 1435842
In these modern software environments, everybody is dumb, but few are honest enough to admit it!  It's become a software minefield out there, with untested software issued by major suppliers desparately seeking plausible deniability!  Stupid hidden workarounds to major disabling operating problems are proposed that still leave the program functionally unuseable, or unscalable to real world sized applications.  I have been trying off and on to get acceptable performance from the btrieve ODBC using VB 4 and RDO, in order to perform massive extracts from very large btrieve files for loading data warehose systems, and have been continually frustrated by an inability to achieve acceptable performance.  This is particularly frustrating, because I know that native btrieve access under DOS is blazingly fast for what I'm trying to do.  

You have to know the page fault is in the .DLL, because that operates in your own address space under windows.  It's only a matter of timing that positions the page fault in any place in your code.

You might check out your BTI.INI file in your windows directory, there are a number of options there that might mask the problem enough to make it useable.  Also the readme files have some information on increasing a few parameters that might help as well.  Let me know if you find any good performance hints/fixes.  I'm probably dumber than you on this one.  cymbolic@aol.com or doug.taylor@hboc.com

thx!  
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1435843
P.S. go to www.pervasive-sw.com and check out the article in the tech papers section called "Advanced Tuning for the Microkernal Engine"  It details the option settings and their meanings.  Also, I noted one reference under page fault regarding applications with out enough stack space causing page faults.  Hey, you aren't running any recursive routines are you?  That could cramp your stack space style in a hurry!
0
 

Author Comment

by:TD092397
ID: 1435844
The problem 'seems' to be solved. There were three different factors involved:

1.) If the data buffer is a user-defined type, do not use ByVal in the call. Otherwise, use it. This makes no sense, considering the data buffer needs to have info returned to it, but hey ! that's life.

2.) The key number argument in the Open call. This is weird. If you declare the variable you pass through explicitly as an integer, then you crash. Use DefInt A-Z, declare the variable with no type specification, and it works. ???

3.) The variable you pass through as the data buffer in the open call has to be the same variable as is used in the rest of the calls. It also has to have module-level scope.

These may not be right (they certainly don't make much sense), but ensuring these 3 issues were dealt with correctly has solved my problem. It took me 3 weeks to figure it out though, so I hope this helps someone else from going thru the same S***.

Thanks very much for your help, cymbolic. Sorry I can't credit you with solving the problem. Hope you manage to sort yours out.

p.s. What do I do now with this problem ?
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1435845
Geez..you're right, none of these changes are intuitive!  How did you figure them out?  I've seldom found anything really useable on the pervasive-sw site.

I think the easiest tning to do is accept the answer, but adjust the points down to zero.  That way the slate's cleared, but the info sticks around for others to view.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

912 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

20 Experts available now in Live!

Get 1:1 Help Now