I have a table (VOL_HAZOX_INFO) that is a SQL View. I can run the table from the designer and see all the fields and records. Results look like this:
ItemNo HazField HazValue
200377 HC 2.1
200377 IMDG_CODE 2124
200377 NAERG 115
200377 SN COMPRESSED GAS, FLAMMABLE, N.O.S.
200377 UN# UN1954
When I try to read the data from code in a report, I get an error "VOL_HAZOX_INFO ItemNo '200377' does not exist."
I am new to this, so I imagine I am doing something simple that is wrong.
The code is:
Hazdata.SETCURRENTKEY(ItemNo);
Hazdata.SETRANGE(ItemNo, "Sales Shipment Line"."No."); ==> this will be 200377
Hazdata.FINDSET;
REPEAT
Hazards := Hazards + Hazdata.HazField;
UNTIL Hazdata.NEXT = 0;
Hazdata is a C/A Global type rec assigned to the VOL_HAZOX_INFO source.
Thanks for any help you can provide.
0
Comments
However, I can't seem to step through the records. The REPEAT..UNTIL code only returns 1 record and the Counter I added stays at 1.
Counter := 0;
REPEAT
AllHazards := AllHazards + Hazdata.HazField + ' ' + Hazdata.HazValue ;
Counter := Counter + 1;
UNTIL Hazdata.NEXT = 0;
The HazData SQL View does not return any unique IDs.
Thanks