Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB5 using Btrieve

Posted on 1997-09-25
7
Medium Priority
?
678 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 800 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

604 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