1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
char PassportNo[64];
char DriverName[64];
char DriverType[32];
unsigned long int DriverMiles;
unsigned long int DriverPhone1;
unsigned long int DriverPhone2;
unsigned long int DriverPhone3;
if(SQLFetch(sqlstatement)==SQL_SUCCESS){
if(SQLGetData(sqlstatement,1,SQL_C_CHAR,&DriverName,64,0)!=SQL_SUCCESS)
{
char DriverName[12]="Not on File";
}
if( SQLGetData(sqlstatement,2,SQL_C_CHAR,&DriverType,32,0)!=SQL_SUCCESS)
{
char DriverType[6]="Error";
}
if(SQLGetData(sqlstatement,4,SQL_C_ULONG,&DriverMiles,64,0)!=SQL_SUCCESS)
{
char DriverMiles[6]="Error";
}
if(SQLGetData(sqlstatement,5,SQL_C_ULONG,&DriverPhone1,11,0)!=SQL_SUCCESS)
{
DriverPhone1=0;
}
if(SQLGetData(sqlstatement,6,SQL_C_ULONG,&DriverPhone2,11,0)!=SQL_SUCCESS)
{
DriverPhone2=0;
}
if(SQLGetData(sqlstatement,7,SQL_C_ULONG,&DriverPhone3,11,0)!=SQL_SUCCESS)
{
DriverPhone3=0;
}
if(SQLGetData(sqlstatement,10,SQL_C_CHAR,&PassportNo,64,0)!=SQL_SUCCESS)
{
char PassportNo[64]="None";
}
}
gotoxy(0,1);
cout << "FullName: "<< DriverName;
gotoxy(0,2);
cout << "Com/IC: " << DriverType;
gotoxy(0,3);
cout << "Miles Last 30 days: "<< DriverMiles;
gotoxy(40,1);
cout << "Driver Phone 1:" << DriverPhone1;
gotoxy(40,2);
cout << "Driver Phone 2:" << DriverPhone2;
gotoxy(40,3);
cout << "Driver Phone 3:" << DriverPhone3;
cout << endl;
gotoxy(0,5);
cout << "Passport Number:" << PassportNo << endl;
|