HelloWorldB4X
New Member
Hello everyone,
I'm really stuck and have been searching for a long time without finding a solution, so I'm reaching out for help.
In VB6.0, I can get the field type of a record using the following method:
Private Rs_EditForm As ADODB.Recordset
Rs_EditForm.Fields.Item(ctl.Name).Type
In B4A, I use JdbcResultSet to retrieve the record set as follows:
Dim rs As JdbcResultSet = SQL.execquery("select * FROM Bolge")
Do While rs.nextrow
LabelIstanbul.Text = rs.getstring2(2)
Loop
rs.Close
We can retrieve data using the following properties and assign them to a MAP or LIST:
Close
ColumnCount
GetBlob
GetBlob2
GetColumnName
GetDouble
GetDouble2
GetInt
GetInt2
GetLong
GetLong2
GetString
GetString2
IsInitialized
NextRow
However, I haven't found a simpler method to get the field types directly. The only way I can indirectly obtain them is through the following query:
SELECT
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
IS_NULLABLE
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'table1' AND TABLE_SCHEMA = 'dbo';
When multiple tables are joined in a query, the above method becomes quite cumbersome.
So, is there any method in JdbcResultSet that can be used to get the field types?
I'm really stuck and have been searching for a long time without finding a solution, so I'm reaching out for help.
In VB6.0, I can get the field type of a record using the following method:
Private Rs_EditForm As ADODB.Recordset
Rs_EditForm.Fields.Item(ctl.Name).Type
In B4A, I use JdbcResultSet to retrieve the record set as follows:
Dim rs As JdbcResultSet = SQL.execquery("select * FROM Bolge")
Do While rs.nextrow
LabelIstanbul.Text = rs.getstring2(2)
Loop
rs.Close
We can retrieve data using the following properties and assign them to a MAP or LIST:
Close
ColumnCount
GetBlob
GetBlob2
GetColumnName
GetDouble
GetDouble2
GetInt
GetInt2
GetLong
GetLong2
GetString
GetString2
IsInitialized
NextRow
However, I haven't found a simpler method to get the field types directly. The only way I can indirectly obtain them is through the following query:
SELECT
COLUMN_NAME,
DATA_TYPE,
CHARACTER_MAXIMUM_LENGTH,
IS_NULLABLE
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = 'table1' AND TABLE_SCHEMA = 'dbo';
When multiple tables are joined in a query, the above method becomes quite cumbersome.
So, is there any method in JdbcResultSet that can be used to get the field types?