TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)

Chapter 6 261
Host Language Access
C
short DBname[6]
Password[4]
Sales_D_Set[4];
char
*Purch_Date = "PURCH-DATE;",
*Equal_Op = " =",
*Item_List ="ACCOUNT,STOCK#,PRICE,TAX,TOTAL,PURCH-DATE;";
/* Define all your global variables. */
struct
Database_Status_Type { short Condition;
short Length;
int Record_Number;
int Chain_Count;
int Back_Pointer;
int Forward_Pointer;
} Status;
struct
Sales_Data_Set_Type {int Account_Number;
char Stock_Number[8];
int Price;
int Tax;
int Total;
char Purch_Date[6];
};
struct
Lock_Descriptor_Type {short Num_Of_Elements;
short Length_Of_Descriptor;
char Data_Set_Of_Descriptor[16];
char Data_Item_Of_Descriptor[16];
char Relop_For_Data_Item[2];
char Value_For_Data_Item[6];
};
short Mode;
Main Body of Program
/* Beginning of the main program */
main()
{
/* Initialize the database and set information */
strcpy ((char *)DBname," ORDERS; ");
strcpy ((char *)Password,"DO-ALL;");
strcpy ((char *)Sales_D_Set,"SALES;");
Open_The_Database();
Get_Sales_For_Date();
exit (0);
}