dbTalk Databases Forums  

INCOMPATIBLE_MODE_ERROR

comp.databases.btrieve comp.databases.btrieve


Discuss INCOMPATIBLE_MODE_ERROR in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default INCOMPATIBLE_MODE_ERROR - 05-26-2007 , 12:21 PM






Hi everyone!
Sorry for posting in this group but there's no group for v6!
I need to do some actions on about 50 files.
But always I get error 88(INCOMPATIBLE_MODE_ERROR) on first few ones.
Then I changed the code to try as many times as needed to get a no
error result.
Now I always get 88 on the 1st file and operations on other files are
done with no error.
I know this error occures when a file is opened in 2 different modes
but in my code
each file is opened , processed , closed and then the next file.And
all in normal mode.
I'm working with Microkernel 6.15 on a single WinXP machine,not a
client server system.
And obviously I can't upgrade.

What should I do?
Can anyone help me.

Thanks.


Reply With Quote
  #2  
Old   
FrisbeeŽ
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 05-29-2007 , 09:52 AM






<mohsen_fakhari (AT) yahoo (DOT) com> wrote

Quote:
Hi everyone!
Sorry for posting in this group but there's no group for v6!
I need to do some actions on about 50 files.
But always I get error 88(INCOMPATIBLE_MODE_ERROR) on first few ones.
Then I changed the code to try as many times as needed to get a no
error result.
Now I always get 88 on the 1st file and operations on other files are
done with no error.
I know this error occures when a file is opened in 2 different modes
but in my code
each file is opened , processed , closed and then the next file.And
all in normal mode.
I'm working with Microkernel 6.15 on a single WinXP machine,not a
client server system.
And obviously I can't upgrade.

What should I do?
Can anyone help me.

Thanks.
The only time I ever get this particular error is if I open a file in
read-only mode and attempt to modify the records (update/delete). Post a
snippet of your code, particularly where the error occurs.




Reply With Quote
  #3  
Old   
Bill Bach
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 05-29-2007 , 11:18 AM



If I had to guess, I'd say that you're running into one of the
following:
1) File is flagged ReadOnly. Flag the file ReadWrite.
2) A conflict with an Anti-Virus application is preventing opening the
file properly. Disable AV & see if the program works.
3) You are not initializing the KeyNumber parameter on the FileOpen
call. Be sure this is set to 0.


As for your last statement -- what is obvious about this? Pervasive
PSQL v9.5 will run most Btrieve 6.x applications with no modifications
whatsoever.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 07/2007 ***


mohsen_fakhari (AT) yahoo (DOT) com wrote:

Quote:
Hi everyone!
Sorry for posting in this group but there's no group for v6!
I need to do some actions on about 50 files.
But always I get error 88(INCOMPATIBLE_MODE_ERROR) on first few ones.
Then I changed the code to try as many times as needed to get a no
error result.
Now I always get 88 on the 1st file and operations on other files are
done with no error.
I know this error occures when a file is opened in 2 different modes
but in my code
each file is opened , processed , closed and then the next file.And
all in normal mode.
I'm working with Microkernel 6.15 on a single WinXP machine,not a
client server system.
And obviously I can't upgrade.

What should I do?
Can anyone help me.

Thanks.


Reply With Quote
  #4  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 06-02-2007 , 12:05 PM



Hi
Thank you for your answers.In fact I was disappointed.
well,I disabled AV completely, nothing changed.
If the files were readOnly,I think I couldn't get any results but I
get NO_ERROR after some attempts.
However I checked them.
And this is the code.It's not readolny mode.

memset(dataBuf , 0 , sizeof(dataBuf) );
memset( keyBuf, 0, sizeof( keyBuf ) );

strcpy(dataBuf , "MA48");
strcpy( (BTI_CHAR *)keyBuf, fileName );

keyNum = 0;
dataLen = 5;
/* open the DAT file */
i = 0;
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
while(status == 88){
fp = fopen("unLog.txt" , "a");
fprintf(fp , "%d," , i);
fclose(fp);
Sleep(SLEEP_TIME);//Some time this sleep reduces the wasted time in
the loop
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
i += 1;
}


Reply With Quote
  #5  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 06-02-2007 , 12:17 PM



And if it's important this code is in a C function that is called from
a Java method
using JNI.


Reply With Quote
  #6  
Old   
FrisbeeŽ
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 06-04-2007 , 09:00 AM



<mohsen_fakhari (AT) yahoo (DOT) com> wrote

Quote:
Hi
Thank you for your answers.In fact I was disappointed.
well,I disabled AV completely, nothing changed.
If the files were readOnly,I think I couldn't get any results but I
get NO_ERROR after some attempts.
However I checked them.
And this is the code.It's not readolny mode.

memset(dataBuf , 0 , sizeof(dataBuf) );
memset( keyBuf, 0, sizeof( keyBuf ) );

strcpy(dataBuf , "MA48");
strcpy( (BTI_CHAR *)keyBuf, fileName );

keyNum = 0;
dataLen = 5;
/* open the DAT file */
i = 0;
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
while(status == 88){
fp = fopen("unLog.txt" , "a");
fprintf(fp , "%d," , i);
fclose(fp);
Sleep(SLEEP_TIME);//Some time this sleep reduces the wasted time in
the loop
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
i += 1;
}
I don't program in C, but I can follow the code (I think) but I'm curious as
to why you are only checking for status 88. If your open returns any other
non-zero status, you'll continue as if the file is opened properly, when it
is not. I suggest you place some code to handle a status other than 88 or
zero.




Reply With Quote
  #7  
Old   
Bill Bach
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 06-04-2007 , 01:21 PM



You don't have your outer loop shown there. Keep in mind that there
will be a short period of time when a database file is closed that the
engine (and subsequently, the OS) is still busy writing out the data.
If you are truely running in a small open/access/close loop, then you
may just be seeing the wait for the OS cache to get flushed.

Not sure why else you'd get this, though I suspect that there is some
OS limitation you are seeing. With the 6.15 workstation engine, you
can probably run SysInternals/Microsoft "FileMon" tool to gain a bit
more insight.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 07/2007 ***


mohsen_fakhari (AT) yahoo (DOT) com wrote:

Quote:
Hi
Thank you for your answers.In fact I was disappointed.
well,I disabled AV completely, nothing changed.
If the files were readOnly,I think I couldn't get any results but I
get NO_ERROR after some attempts.
However I checked them.
And this is the code.It's not readolny mode.

memset(dataBuf , 0 , sizeof(dataBuf) );
memset( keyBuf, 0, sizeof( keyBuf ) );

strcpy(dataBuf , "MA48");
strcpy( (BTI_CHAR *)keyBuf, fileName );

keyNum = 0;
dataLen = 5;
/* open the DAT file */
i = 0;
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
while(status == 88){
fp = fopen("unLog.txt" , "a");
fprintf(fp , "%d," , i);
fclose(fp);
Sleep(SLEEP_TIME);//Some time this sleep reduces the wasted time in
the loop
status = BTRV(B_OPEN, posBlock, dataBuf, &dataLen, keyBuf, keyNum );
i += 1;
}


Reply With Quote
  #8  
Old   
mohsen_fakhari@yahoo.com
 
Posts: n/a

Default Re: INCOMPATIBLE_MODE_ERROR - 06-05-2007 , 02:19 AM



I'm checking just 88 because just this error is solved after some
tries.
Other errors should be handled basically.

I can't upgrade since I don't have access to other versions.
This is what I'm given.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.