- SQL code
string Is_PublisherID string Is_BookID int Il_i integer Is_Number,Is_Words,Is_flag1 date Id_Publish String Is_ISBN,Is_Title,Is_Author, Is_Keyword,Is_Abstract double Is_price if sle_bookid.text=""or iSNull(sle_bookid.text)then messagebox("缺少数据","请输入图书编号") sle_bookid.setfocus() return end if if sle_publish.text<> " " and not isnull(sle_publish) then if isDate(sle_publish.text) then Id_Publish=Date(sle_publish.text) else messagebox("输入数据错误","请使用“年-月-日”的日期格式") sle_publish.setfocus() return end ifend if Is_BookID=(sle_bookid.text) Is_ISBN=trim(sle_isbn.text) Is_Title=trim(sle_title.text) //Id_Publish=trim(sle_publish.text) Is_Author=trim(sle_author.text) Is_Words=integer(sle_words.text) Is_PublisherID=(sle_publisherid.text) Is_Number=integer(sle_number.text) Is_price=double(sle_price.text) Is_Keyword=trim(sle_keyword.text) Is_Abstract=trim(sle_abstract.text) Is_flag1=0 select Book_Id into :Il_i from bookinfo where Book_Id=:Is_BookID; if Il_i<>0 then messagebox("信息错误","图书编号第"+string(Il_i)+"号重号!请改正") sle_bookid.setfocus() return end if insert into bookinfo// long ls_flag=0// insert into BookInfo(BookID,ISBN,Title, Publish,Author,Words,// PublisherID,Number,price,Keyword, Abstract,flag)// values(:Is_BookID, :Is_ISBN, :Is_Title, :Id_Publish, :Is_Author, :Is_Words, :Is_PublisherID, :Is_Number, :Is_price, :Is_Keyword, :Is_Abstract, :Is_flag1); commit; sle_bookid.text="" sle_isbn.text="" sle_title.text="" sle_publish.text="" sle_author.text="" sle_words.text="" sle_publisherid.text="" sle_number.text="" sle_price.text="" sle_keyword.text="" sle_abstract.text="" sle_bookid.setfocus()
------解决方案--------------------
像这样:
string ls_dberr
if sqlca.sqlcode <> 0 then
ls_dberr = sqlca.sqlerrtext
rollback;
messagebox('错误', ls_dberr)
return
else
commit;
end if
------解决方案--------------------
- C/C++ code
commit;
------解决方案--------------------
------解决方案--------------------
要有类似下面的代码:
- C/C++ code
sqlca.dbms="odbc" sqlca.database="webdw" sqlca.autocommit=false sqlca.dbparm="connectstring=''dsn=webdw;uid=dba;pwd=sql''" connect using sqlca;
------解决方案--------------------
路过了,他们都回答了