Myr0n Active Member Licensed User Longtime User Jan 25, 2015 #1 I am trying to guess how to read some properties from a variable. My code is Code: Dim db As JackcessDatabase db.Open(File.DirRootExternal & "/Northwind.mdb") Dim Table As JackcessTable Table.Initialize(db.GetTable("FieldTypes")) Table.Reset The properties that I want to read are from the variable Table, like the screenshot, and I am interesting in one of those properties, that is highlighted on the screenshot. Could you help me please. Thank you so much.
I am trying to guess how to read some properties from a variable. My code is Code: Dim db As JackcessDatabase db.Open(File.DirRootExternal & "/Northwind.mdb") Dim Table As JackcessTable Table.Initialize(db.GetTable("FieldTypes")) Table.Reset The properties that I want to read are from the variable Table, like the screenshot, and I am interesting in one of those properties, that is highlighted on the screenshot. Could you help me please. Thank you so much.
Erel B4X founder Staff member Licensed User Longtime User Jan 25, 2015 #2 I guess that the library doesn't expose this property. You will need to use Reflection to get this value. It is not so simple in this case. Upvote 0
I guess that the library doesn't expose this property. You will need to use Reflection to get this value. It is not so simple in this case.
Myr0n Active Member Licensed User Longtime User Jan 27, 2015 #3 Ok, thank you Erel, Before to post this message I tried with JavaObject but I did not have good results. I tried with the actual wrapped library Jackcess but the problem that I found is that there is not include a method getColumns() that exists in java. I tried with Dim JO as JavaObject Log(jo.RunMethod("getcolumns",Array As Object(""))) the previous said code gave the error: java.lang.RuntimeException: Method: getcolumns not found in: anywheresoftware.b4a.objects.JackcessDatabase$JackcessTable and the next one, Log(jo.GetField("_columns")) said: java.lang.RuntimeException: Field: _columns not found in: anywheresoftware.b4a.objects.JackcessDatabase$JackcessTable anyone has a similar code where I can do some test I figure out, please. Thank you Upvote 0
Ok, thank you Erel, Before to post this message I tried with JavaObject but I did not have good results. I tried with the actual wrapped library Jackcess but the problem that I found is that there is not include a method getColumns() that exists in java. I tried with Dim JO as JavaObject Log(jo.RunMethod("getcolumns",Array As Object(""))) the previous said code gave the error: java.lang.RuntimeException: Method: getcolumns not found in: anywheresoftware.b4a.objects.JackcessDatabase$JackcessTable and the next one, Log(jo.GetField("_columns")) said: java.lang.RuntimeException: Field: _columns not found in: anywheresoftware.b4a.objects.JackcessDatabase$JackcessTable anyone has a similar code where I can do some test I figure out, please. Thank you
Erel B4X founder Staff member Licensed User Longtime User Jan 27, 2015 #4 Try to use Reflection library instead. JavaObject only allows you to access public fields and methods. These fields are probably private. Upvote 0
Try to use Reflection library instead. JavaObject only allows you to access public fields and methods. These fields are probably private.
Myr0n Active Member Licensed User Longtime User Jan 28, 2015 #5 Thank you Erel, I start working on it. Upvote 0