I'm new here. Trying to use code posted by aeric in this post.
works fine with his dbf file and even some of my other dbf files but runing into error with few other of my own files.
Looks like there is field that code doesn't like it but my table is simple. This is from DBF viewer.
Is there better way for me to debug this?
Thank you.
[DBF] Read/Write DBF file using jDBF
https://www.b4x.com/android/forum/threads/aceesing-dbf-files.47068/ The example above works but the characters are not displaying correctly. With some trial-and-error, I finally get it works like the Test.java 'Non-UI application (console / server application) #Region Project Attributes...
www.b4x.com
works fine with his dbf file and even some of my other dbf files but runing into error with few other of my own files.
Error:
Waiting for debugger to connect...
Program started.
Error occurred on line: 27 (Main)
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at anywheresoftware.b4j.object.JavaObject.InitializeNewInstance(JavaObject.java:91)
at b4j.example.main._readdbf(main.java:101)
at b4j.example.main._appstart(main.java:59)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:629)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:234)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:167)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:109)
at anywheresoftware.b4a.shell.ShellBA.raiseEvent2(ShellBA.java:98)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:96)
at b4j.example.main.main(main.java:29)
Caused by: com.hexiong.jdbf.JDBFException: The field type is not a valid. Got: 0
at com.hexiong.jdbf.JDBField.<init>(JDBField.java:47)
at com.hexiong.jdbf.DBFReader.readFieldHeader(DBFReader.java:176)
at com.hexiong.jdbf.DBFReader.init(DBFReader.java:58)
at com.hexiong.jdbf.DBFReader.<init>(DBFReader.java:28)
... 22 more
Program terminated (StartMessageLoop was not called).
Looks like there is field that code doesn't like it but my table is simple. This is from DBF viewer.
Is there better way for me to debug this?
Thank you.
Field | Type | Field Size | Decimal |
COMPANY_ID | C | 8 | 0 |
PRICE_Y1 | C | 9 | 0 |
PRICE_Y2 | C | 9 | 0 |
PRICE_Y3 | C | 9 | 0 |
PRICE_Y4 | C | 9 | 0 |
PRICE_Y5 | C | 9 | 0 |
PRICE_Y6 | C | 9 | 0 |
PRICE_Y7 | C | 9 | 0 |
PRICEH_Y1 | C | 9 | 0 |
PRICEH_Y2 | C | 9 | 0 |
PRICEH_Y3 | C | 9 | 0 |
PRICEH_Y4 | C | 9 | 0 |
PRICEH_Y5 | C | 9 | 0 |
PRICEH_Y6 | C | 9 | 0 |
PRICEH_Y7 | C | 9 | 0 |
PRICEL_Y1 | C | 9 | 0 |
PRICEL_Y2 | C | 9 | 0 |
PRICEL_Y3 | C | 9 | 0 |
PRICEL_Y4 | C | 9 | 0 |
PRICEL_Y5 | C | 9 | 0 |
PRICEL_Y6 | C | 9 | 0 |
PRICEL_Y7 | C | 9 | 0 |
PRICEO_Y1 | C | 9 | 0 |
PRICEO_Y2 | C | 9 | 0 |
PRICEO_Y3 | C | 9 | 0 |
PRICEO_Y4 | C | 9 | 0 |
PRICEO_Y5 | C | 9 | 0 |
PRICEO_Y6 | C | 9 | 0 |
PRICEO_Y7 | C | 9 | 0 |
PRICEV_Y1 | C | 13 | 0 |
PRICEV_Y2 | C | 13 | 0 |
PRICEV_Y3 | C | 13 | 0 |
PRICEV_Y4 | C | 13 | 0 |
PRICEV_Y5 | C | 13 | 0 |
PRICEV_Y6 | C | 13 | 0 |
PRICEV_Y7 | C | 13 | 0 |