Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Erro if Using Btrieve under Domain User Privilege 1

Status
Not open for further replies.

jitu11875

Technical User
Nov 3, 2000
22
0
0
US
I was using btrieve in Win NT and Win98. But in WIN2000 under the "Domain User" privilege error code 20 is shown.
If the "Domain User" is changed to "domain Admin" every thing works fine.
Please suggest what might be the possible error
 
What version of Btrieve are you using? v6.15 and v7.0 weren't tested on Windows 2000. There are some registry settings that are handled differently under Windows 2000 than they were under Windows NT. A user won't be able to write to the HKEY_Local_Machine registry key.

 
Mirtheil,
Thanks for the help I was eager to know that how can we tackle this error. I am using 6.15V.
Secondly I was trying to work out a utility using the VC++6
If I am using a console i.e dos based application things work fine but in GUI based with VC++ I am getting error 27 where as the same code works fine with dos.


this is the function I am using. I under stand that UR in VB but I feel the calling conventions are the same
Here the File_Buf_1 is the structure that has the details of file and the key specifications.
Can U help me in the possible cause of error.


int Create_MCD_File(char* File_Name,char* MCD_Pos)
{

BTI_WORD Buf_Len; // holds length of buffer for btrv

memset(&File_Buf_1,0,sizeof(File_Buf_1));

File_Buf_1.Rec_Len = 53;
File_Buf_1.Page_Siz = 1024;
File_Buf_1.Variable = VAR_RECS;
File_Buf_1.Ndx_Cnt = 1; // number of physical keys

File_Buf_1.Key_Buf[0].Key_Pos = 1;
File_Buf_1.Key_Buf[0].Key_Len = 12;
File_Buf_1.Key_Buf[0].Key_Flag = BINARY;
Buf_Len = sizeof(File_Buf_1);

return (BTRV (B_CREATE, MCD_Pos, &File_Buf_1, &Buf_Len, File_Name, PRIME_KEY ));;
}
 
We had a problem a bit like this a little while ago. Our server crashed, and we had to get it rebuilt - when we did this we found that we couldn't access our files using the btrieve requester unless we gave our files full access to everyone - it turned out in the end that the problem was related to the fact that the user id that runs the pervasive service on the server wasn't part of the correct user group.
 
Hi Mirtheil,
I have used the same syntex as to create and tried to pass the Open insted of Create to a pre created file and there is no error in opening the file. Can U seggest the cause as the same code can open a pre existing file but can't create a new file.If as per the error code 27 I am having error in Key set then why don't I have the same error in opening.
Please help. I am using 6.15V and under win 2000. The same code works fine when a dos based application is created in C++. Both open and create works fine
Thanks in advance for help
jitendar

 
Just looking at the code, I don't see anything wrong with it. But you are missing several parts of the File Specifications and Key Specifications. Can you post the structure of the File_Buf_1 and the Key_Buf[]?
The one missing piece of information that jumps out at me is that you don't have the Data Type set for the Key_Buf[0].
One other thing to try is to turn on Btrieve Tracing and verify that the Create is being sent correctly to the engine.
The reason the Open doesn't fail when the Create fails is because the Open just opens the file and the Create is actually trying to make sure the file is valid. The Open doesn't do anything with keys.

 
Hi Mirtheil,
Feeling comfortable as UR suggestions are very helpfull to me. I am also learning new things from it. I am not aware of any thing as btrieve tracing and I am just using the DLL and the header files provided by btrieve. My application doesn't interact with any thing more than DLL of btrieve. Thus I am not aware of any thing like btrieve tracing.
I am pasting the structure for the File as well as key and
this structure is working fine with the DOS based application but with the windows based application it's giving error.

Can U suggest me some thing like the book or the text which says about the window based developement using btrieve.
I am from India and I have not seen much things happening on Btrieve thus in the market too not text material is available. The book with the 6.15 version of btrieve says a single line error and doesn't say about how to tackle.

Thanks for all the help.

Thanks,
jitendar

typedef struct /* spec's to define "1" key/segment */
{
short int Key_Pos; /* start position of key in record */
short int Key_Len; /* length of key */
short int Key_Flag; /* key definition field */
char Not_Use1[4]; /* btrv. extra space not used */
char ExtendedKey;
char Reserve1[5]; /* btrv. extra space not used */
} Key_Spec ;

typedef struct /* allows "1" key/segment*/
{
short int Rec_Len; /*minimum record size or exact size*/
short int Page_Siz; /* buffer size 512-4096*/
short int Ndx_Cnt; /* number of keys defined*/
long Record_Cnt; /* # of records in file */
short int Variable; /* flag to set if records are var. length */
char Reserve2[4]; /* btrv. extra space not used*/
Key_Spec Key_Buf[1]; /* array of key definitions */
} Fil_Spec_1;
 
The only thing I've seen wrong so far is that you aren't setting a data type for the key in the Key_Spec.ExtendedKey. That should be set as well.
The Btreive Tracing is handled by the engine and is configurable by using the setup program. Since you have the headers, it sounds like you've got the SDK. There should be a couple of manuals. The User's Guide should have information about tracing and the Programmer's Reference has information about each Btrieve call.
Some of the information is available on the Pervasive web site ( in the online manuals section. These manuals are geared more for v7.0 and later but the Btrieve calls haven't changed.
 
Hi Mirtheil,
Thanks for all the help. I got the solution and it was something to do with the way I was compiling the code. It's amazing that the precompiled directives can make UR exe run in a different way and then may cause error while executing the programe.
I haven't seen the exact thingthat is to be changed in the compile option but in one of my earlier programe we had some setting and making these setting in the new one made it possible to run
I am not aware of how come the compile option was making the btrieve perform errorneous.
I will let U know once find the cause of error.
Bye and thanks
jitendar
 
You should get a copy of the Pervasive.SQL 2000 SDK which has all the headers and docs and a 3 user engine so you can do all the Btrieve or SQL development against the same data if you want. It is almost assurred that you are going to have problems using v6.15 with Win2K and there are other issues that could cause you a lot of problems if you're not quite knowledgeable and have been using Btrieve for years. It's not likely that you are only using a DLL if you're using v6.15 unless you are talking about the requesters, wbtrcall.dll and wbtrcomm.dll. If you are using wbtrcall.dll then you are using a 16-bit DLL and engine and that can cause problems of it's own. You may even be using a Btrieve 5.x DLL and if you plan to distribute this commercially you probably don't have legal rights to do so with those DLLs. Contact Pervasive and they can help you get all the right info and products to develop and deploy and if it's done right it shouldn't cost you much if anything up front, in fact there are ways to do it so that the database portion of your app can actually make you some money to cover support and tools and such. I'd try sales@pervasive.com. If this is just a school project or something on the side the latest SDK is freely downloadable as are eval version of all our products so your customers, when you get them, could just purchase whatever engine they needed if you didn't want to bundle and/or embed.

Pervasivite
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top