hi all,
i am using ado library for establish a connection with MS-Access database.
MS-Access table contains Navision Table Names.
i have got a string from a query dynamically, it contains Navision Table Name.
now i would like to initialize the Table with that name.
so that i can modify the navision Data.
hOw can i translate the string variable to record variable?
plz concern this as seriously....
thanks,
Ramesh.
0
Comments
Define local variable of type record and subtype 2000000001 Object
also define a local variable Table of type RecordRef.
// This little sample of code will count the records in a table
Object.SETRANGE(Type,Object.Type::Table); // Only Tables have records. What?! You didn't know that?
Object.SETRANGE(Object.ID,1,10); // For this sample, count only records in tables 1..10.
Object.FIND('-'); // IF THEN? Hopefully you have some object in your database!
REPEAT
Table.OPEN(Object.ID); // Open Record reference to current table.
MESSAGE(Text000,Object.Vardas,Table.COUNT); // Show you what was found.
UNTIL Object.NEXT = 0;
Object.SETRANGE(Type,Object.Type::Table);
Object.SETFILTER(Object.Name,'TableNameYouGetFromADO');
IF Object.FIND('-') THEN Table.OPEN(Object.ID);
but i am also getting the field names dynamically from Access table.
then i need to assign the valuesin navision like this...
here field name is a Text variable.
field name:=format(recorset.fields.item(i).value);
recordref.init;
recordref."field name" := 'asdf';
recordref.insert;
here i am getting the field name from another recordset.
while compiling it is getting an error message that the fieldname is nota field in the record.
if u mean the same then jus verify this again...
thaks..
so define a variable (i called it reclField) of type Record of subtype Field
then use the following:
//by the way how is it going there in India with Navision products and life in general ?