Home > database >  How to import more than 32 k objects CompileEntryImport
How to import more than 32 k objects CompileEntryImport

Time:09-24

Int PBORCA_CompileEntryImport (PBORCA hORCASession, LPSTR lpszLibraryName, LPSTR lpszEntryName, PBORCA_TYPE otEntryType, LPSTR lpszComments, LPSTR lpszEntrySyntax, LONG lEntrySyntaxBuffSize, PBORCA_ERRPROC pCompErrorProc, LPVOID pUserData);
CompileEntryImport unable to import more than 32 k objects, lpszEntrySyntax statement into a blob type also not line, the function returns a value of 0, but couldn't find the object in the PBL, less than 32 k objects, there is no problem, master how to deal with, please?

CodePudding user response:

Tested, you can import more than 32 k, you first try this object on pb own import function can import

CodePudding user response:

Pb's own import can successfully imported, my code is as follows:
Disclaimer:
The public function long sessionopen () library "PBORC90. DLL" alias for "PBORCA_SessionOpen
"Public subroutine sessionclose (long horcasession) library "PBORC90. DLL" alias for "PBORCA_SessionClose
"The public function integer sessionsetlibrarylist (long horcasession, ref string plibnames [], an integer inumberoflibs) library "PBORC90. DLL" alias for "PBORCA_SessionSetLibraryList
"The public function integer sessionsetcurrentappl (long horcasession, string lpszappllibname, string lpszapplname) library "PBORC90. DLL" alias for "PBORCA_SessionSetCurrentAppl
"The public function integer libraryentryexport (long horcasession, string lpszlibraryname, string lpszentryname, long otentrytype, ref string lpszexportbuffer, long lexportbuffersize) library "PBORC90. DLL" alias for "PBORCA_LibraryEntryExport
"The public function integer compileentryimport (long horcasession, string lpszlibraryname, string lpszentryname, long otentrytype, string lpszcomments, blob lpszentrysyntax, long lentrysyntaxbuffsize, long pcomperrorproc, long puserdata) library "PBORC90. DLL" alias for "PBORCA_CompileEntryImport
"
The import function of_importfile:
Long li_handle
Long ll_sid
Long ll_index
The integer li_result


Ll_sid=sessionopen ()
Li_result=sessionsetlibrarylist (ll_sid as_library, upperbound (as_library))

If li_result=0 then
Li_result=sessionsetcurrentappl (ll_sid, as_library [1], as_appl)

If li_result=0 then
Li_result=compileentryimport (ll_sid, as_pbl, as_object al_type, "Messagebox - & gt; Gf_msgbox, "ab_syntax, len (ab_syntax), 0, 0)

If li_result & lt;> 0 then
Li_handle=fileopen (" status. TXT ", linemode! The write! , lockwrite! , append!)
Filewrite (li_handle, string (li_result) + "-" + + "-" + as_pbl as_object + '(compileentryimport))
Fileclose (li_handle)
The else
Li_handle=fileopen (" status. TXT ", linemode! The write! , lockwrite! , append!)
Filewrite (li_handle, string (li_result) + "-" + + "-" + as_pbl as_object + '(compileentryimport))
Fileclose (li_handle)
End the if

The else
Li_handle=fileopen (" status. TXT ", linemode! The write! , lockwrite! , append!)
Filewrite (li_handle, string (li_result) + "-" + + "-" + as_pbl as_object + '(sessionsetcurrentappl))
Fileclose (li_handle)
End the if

The else
Li_handle=fileopen (" status. TXT ", linemode! The write! , lockwrite! , append!)
Filewrite (li_handle, string (li_result) + "-" + + "-" + as_pbl as_object + '(sessionsetlibrarylist))
Fileclose (li_handle)
End the if

Sessionclose (ll_sid)
Return li_result

Call into the function code:
The integer li_handle li_ret, li_i li_j, li_EntryType, li_loops
String ls_dir ls_filename, ls_fileext, ls_targetpbl
String ls_library []
Long ll_filelen
Blob lb_1, lb_syntax
Ls_dir=sle_sourcedir. Text
Ls_library [1]=sle_targetpbl. Text
SetPointer (HourGlass!
For li_i=1 to lb_sourcefilelist. Totalitems ()
Ls_filename=lower (left (lb_sourcefilelist. Text (li_i), len (lb_sourcefilelist. Text (li_i)) - (4))
Ls_fileext=lower (right (lb_sourcefilelist. Text (li_i), 3))
Choose a case ls_fileext
Case 'sra'
Li_EntryType=0
Case 'SRD'
Li_EntryType=1
Case 'SRF'
Li_EntryType=2
Case 'SRM'
Li_EntryType=3
Case 'SRQ'
Li_EntryType=4
Case 'SRS'
Li_EntryType=5
Case 'sru'
Li_EntryType=6
Case 'SRW'
Li_EntryType=7
In case the else
The continue
The end choose
Ls_targetpbl=sle_targetpbl. Text
If the lower (ls_targetpbl, 4) (right) & lt;> 'both PBL' then
Ls_targetpbl=ls_targetpbl + 'PBL'
End the if



//Get the file length, and open the file
Ll_filelen=FileLength (ls_filename + "" + ls_fileext)
Li_handle=fileopen (ls_filename + "" + ls_fileext, StreamMode! , Read! , LockRead!)
//Determine how many times to call FileRead
If ll_filelen & gt; Then 32765
If the Mod (ll_filelen, 32765)=0 then
Li_loops=ll_filelen/32765
The else
Li_loops=(ll_filelen/32765) + 1
End the if
The else
Li_loops=1
End the if
//Read the file
For li_j=1 to li_loops
FileRead (li_handle lb_1)
Lb_syntax=lb_syntax + lb_1
Next
Li_ret=fileclose (li_handle)

//messagebox (' ', a string (len (lb_syntax)))
In_cst_pborc. Of_importfile (lb_syntax ls_filename, li_EntryType, ls_targetpbl, ls_library [], 'aa')
Next
Messagebox (' sure ', 'object import success! 'the information!nullnullnullnullnullnullnullnullnullnullnull
  • Related