//Gets records from a MS Access Database #include #include #include #include #define database = northwind.mdb; int main () { int f,buf; int isuccess = 0; printf ("Lists records in database\n"); printf ("**************************\n\n"); if (chmod("northwind.mdb",S_IWRITE)!=-1 && (f=open ("northwind.mdb",O_RDWR | O_BINARY))!=-1) { //handle, offest, origin if (lseek (f,0,SEEK_SET)!=1) { if (read (f,&buf,2)==2 && buf==0x037D) { printf ("Reading records"); lseek (f,346345,SEEK_SET); buf=0x9090; //nop nop if (write(f,&buf,2)==2) { printf ("Success."); } else { printf ("Failed due to unknown reason."); } } else { printf("Cannot find start location. File may not be .mdb file"); } } else { printf("Seek error."); } close(f); } else { printf ("Cannot find northwind.mdb"); } return isuccess; }