If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Convert the application from Btrieve to Pervasive

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Convert the application from Btrieve to Pervasive

We have a Delphi4 application with btrieve6.
We want to convert this to pervasive latest version.
Application uses buffer lenth, declare the dta files in record and access it over the place, and datbase extension is "dta" not "dat".
I have no idea how btrieve work
IS it possible to upgrade the data to pervasive with out modifiing the source code much?

Thanks for the any infomation
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Dec 2001
Posts: 1,071
If the application is a 32 bit application and uses the Btrieve API, you should be able to just run the existing application against the newer version of Pervasive. If it uses Scalable SQL, you will have to re-write all calls to use ODBC instead of Scalable SQL.
The extension of the data file does not matter. Pervasive can use any extension as long as the application specifies it.

My suggestion would be to download the trial version of the workgroup engine from Pervasive's web site (PervasiveŽ PSQL), install it on a test machine, and try your application.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Thank you very much for the reply.
I don't understand what you mean by scalable sql.As its not using Sql at all.
Pervasive version11 is not supported for this code


Here is a sample code
//To assign a table
//if its a Client table file_index =2; s = client.dta

procedure com_assign_btrv(file_index : integer; s : string80);
begin
s := s + #0;
move(s[1],nfname[find_btrv_index(file_index)],length(s));
end;
//here move is a Delphi/system.pas call

nfname : array[1..numfile] of
record
case integer of
1:(value : array[1..fname_maxlen] of char);
2:(start : integer);
end;

Thank you
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Dec 2001
Posts: 1,071
Scalable SQL was the SQL interface offered by Btrieve / Pervasive before the current SQL engine. If your application uses the Btrieve interface, you don't need to worry about it.

Where is your BTRV (or BTRIVID, BTRCALL, BTRCALLID) call? The code you provided isn't making a Btrieve call.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #5 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Sorry for my question, I'm really in confuse how they use the btrieve,
It looks like the read data from a buffer, with delphi calls, nowhere I can find BTRV (or BTRIVID, BTRCALL, BTRCALLID) call. Here btrv key word is used , but actually its not a real BtrApi32.pas calls, its a custom designed functions to read from dta file
Here is an example get a patient's first record.
I didn't include all functions here , but I'm sure all these functions are not btrv related

Thank you very much


--------------------------

patientrec = record
nodoss : string[6];
famille : string[20];
prenom : string[20];
end;


procedure Tmainfm.showPatient;
var
patientr: patientRec;
begin
com_assign_btrv(f_patient,return_file_name_f_patie nt);
com_dlen_btrv(f_patient,sizeof(patientrec));
com_op_btrv(b_open, f_patient, p_dummy, p_dummy, 0);
com_op_btrv(b_GETLW_NO_LOCK, f_patient, patientr, p_dummy, 0);
edNom.Text := patientr.famille+ ' ' +patientr.prenom;
com_op_btrv(b_close,f_patient,p_dummy,p_dummy,0);
end;

procedure com_assign_btrv(file_index : integer; s : string80);
begin
s := s + #0;
move(s[1],nfname[find_btrv_index(file_index)],length(s));
end;

procedure com_op_btrv(op : integer; file_index : integer; var rec;
var key; key_index : integer);
begin
if (op mod 50) = b_begin then
transaction_active := true;

normal_com_op_btrv(op,file_index,rec,key,key_index );
if op = b_end then
transaction_active := false;
end;
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Dec 2001
Posts: 1,071
Have you tried the application with Pervasive v11? Does it work? Are you getting errors? The Btrieve API hasn't changed since the v6 days. An app should still work even with v11.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Jan 2013
Posts: 4
Its working until version 10. There to the version has to dowgraded to 6, but above version10 we can't change the version to 6.

Hope it will work fine with the migrate Btrieve to Pervasive


Thank you very much
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On