A Collection can be made available to ODBC by following two
1.By exposing methods of the Object(s) of the Collection.
2.By using Collection attribute 'Is ODBC Table
Exposing Methods to ODBC
By prefixing '_ to external method(s) of an internal object or method(s) of an external Object can be exposed to ODBC.
- By default all the methods of the internal objects are exposed to ODBC
- Only First level methods of an Object can be exposed directly
[#Object : Ledger]
_Difference : $ClosingBalance -$OpeningBalance
The code snippet alters an internal object, Ledger, to add an external method, _Difference and
exposes it to ODBC.
Exposing Collections to ODBC
A Collection is exposed to ODBC by using the attribute, IsODBCTable.
[Collection : Vouchers]
Type : Voucher
Is ODBCTable: Yes
The Collection Vouchers is exposed to ODBC by using the attribute IsODBCTable.
after doing that you can use either of
TallyCn = New ADODB.Connection();
ADODB.Recordset rst = New ADODB.Recordset();
rst.Open ("Select $Name From Ledger", TallyCn, adOpenDynamic, adLockOptimistic);
objCmd.ActiveConnection = TallyCn;
objCmd.CommandType = adCmdStoredProc;
objCmd.CommandText = "_PartyBills";
//'Pass the the Stock Item Name as Parameter
//'Call the SQL procedure
DataSet objRs = objCmd.Execute();