(1)下面是程序中的SQL語句:
mSqlStr = "INSERT INTO BORROW (READER_ID, BOOK_ID, BORROW_DATE, B_CLERK_ID) VALUES('";
// mSqlStr = "INSERT INTO BORROW (READER_ID, BOOK_ID, B_CLERK_ID) VALUES('";
mSqlStr = mSqlStr + m_strReaderID;
mSqlStr = mSqlStr + "','";
mSqlStr = mSqlStr + m_strBookID;
mSqlStr = mSqlStr + "','";
mSqlStr = mSqlStr + "', m_BORROW_DATE,'"; //獲取系統時間SYSDATE
mSqlStr = mSqlStr + "','";
mSqlStr = mSqlStr + m_strUserID;
mSqlStr = mSqlStr + "')";
(2)下面是數據庫中對應表的結構:
(3)下面是程序運行時編譯器的錯誤提示:
![圖片說明](http://img.ask.csdn.net/upload/201507/04/1435978126_183775.png)
(4)謝謝大家了,幫幫忙吧,我是初學者,MFC裡面SQL語句搞復雜了就看不懂,簡單的還是懂,一復雜看起來就眼睛花了
mSqlStr = mSqlStr + "','";
mSqlStr = mSqlStr + "', m_BORROW_DATE,'"; //獲取系統時間SYSDATE
mSqlStr = mSqlStr + "','";
這幾行多了單引號,上面拼接出來是"','',m_BORROW_DATE'','";這個格式不對,有兩個單引號,而且m_BORROW_DATE成字符串了,不是變量
改成
mSqlStr = mSqlStr + "','";
mSqlStr = mSqlStr + m_BORROW_DATE; //獲取系統時間SYSDATE
mSqlStr = mSqlStr + "','";