CDaoDatabase
-
Hi friends, I use above class and CDaoRecordset for writing into xls file. I set one button. on button event, i write following code CString Sql,Name,Addr; GetDlgItemText(IDC_NAME,Name); GetDlgItemText(IDC_ADDRESS,Addr); db.Open("Pis.xls"); Sql = "SELECT * FROM Pis"; recset.Open(CRecordset::forwardOnly,Sql,NULL); recset.AddNew(); recset.SetFieldValue("Name",(LPCSTR)Name); recset.SetFieldValue("Addr",(LPCSTR)Addr); recset.Update(); recset.Close(); db.Close(); } when I enter name and address and click on button, error message come could'nt open database. unrecognise database format friend kindly give me a reply. why i am not able to write and read data from xls Regards kedar Girish Software Developer
-
Hi friends, I use above class and CDaoRecordset for writing into xls file. I set one button. on button event, i write following code CString Sql,Name,Addr; GetDlgItemText(IDC_NAME,Name); GetDlgItemText(IDC_ADDRESS,Addr); db.Open("Pis.xls"); Sql = "SELECT * FROM Pis"; recset.Open(CRecordset::forwardOnly,Sql,NULL); recset.AddNew(); recset.SetFieldValue("Name",(LPCSTR)Name); recset.SetFieldValue("Addr",(LPCSTR)Addr); recset.Update(); recset.Close(); db.Close(); } when I enter name and address and click on button, error message come could'nt open database. unrecognise database format friend kindly give me a reply. why i am not able to write and read data from xls Regards kedar Girish Software Developer
did you specify the pis.xls path correctly? pls check the path of the xls file i mean db.open("path\\pis.xls") give path correctly and i hope it works correctly. cheers, uday. uday kiran