Chessforeva / JavaFoxDBF

Java class for DOS FOXPRO or Visual FoxPro database DBF with IDX index
2 stars 3 forks source link

memo field #1

Open jhrgit opened 6 years ago

jhrgit commented 6 years ago

Dear chessforeva, i tried to read a fox database (a set of .dbf with .fpt files) using JavaFoxDBF. For most of the columns JavaFoxDBF works like a charm. However, i am not able to print the content of memo-fields. The "size" of those fields is "10" (displayed by some other DBF-tool). In method getfieldsValues() for ftype='M' or 'G' the if-clause 'len>0' is always false and i divine that this should not be the case for the memo-fields i have in my table?! Is the feature of reading and writing text to a field with type "memo" supported by JavaFoxDBF? Do you have any suggestions? Is there any other open-source tool that i should give a try? Thanks in advance!

Chessforeva commented 6 years ago

Hi!

I've created this code for searching in dbfs purposes. Mostly free codes ignore indexes which was bad for me. I really advice not to write in foxpro databases via java. Good to search & read bunch of records only. Awesomeness of foxpro database: seek by the index key, scan rest while

and read data (fastest way) Without problem. Static old foxpro database files any length under 2Gb of course. Database administrators would use migration tools to SQL (which is modern) and then do whatever needed with data. There is SQLite nowadays, for example. Or Microsoft SQL if solid. Now about memo fields. The file .FPT is the additional file that contains the data. The 10sized value in .DBF is a file POINTER (so, numeric value) to look in this .FPT file. Do this: String Notes = db.Field[ db.FieldI("Notes") ].stringValue(); Or if memo contains bytes (more than a text string): db.BINARY_CHARS = true; byte[] bPicArray2 = db.Field[ db.FieldI("Picture") ].Binaries(); Please, remember that FoxPro was developed in times when power off-switched PC resulted in corruption of memo files .FPT and index files .CDX,.IDX. So, there was the reindexing thing done always after. SQL separated server-client, so this problem disappeared. Always look for a database engine if data are important :) Cheers, Chessforeva Dev. 2017-12-24 15:28 GMT+02:00 jhrgit : > Dear chessforeva, > i tried to read a fox database (a set of .dbf with .fpt files) using > JavaFoxDBF. > For most of the columns JavaFoxDBF works like a charm. > However, i am not able to print the content of memo-fields. > The "size" of those fields is "10" (displayed by some other DBF-tool). > In method getfieldsValues() for ftype='M' or 'G' the if-clause 'len>0' is > always > false and i divine that this should not be the case for the memo-fields i > have in my table?! > Is the feature of reading and writing text to a field with type "memo" > supported by JavaFoxDBF? > Do you have any suggestions? Is there any other open-source tool that i > should give a try? > Thanks in advance! > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > , or mute the thread > > . >