多多色-多人伦交性欧美在线观看-多人伦精品一区二区三区视频-多色视频-免费黄色视屏网站-免费黄色在线

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > 數據庫 > MySql > MSSQL數據庫不能手動創建新的連接

MSSQL數據庫不能手動創建新的連接

來源:程序員人生   發布時間:2013-11-18 10:01:12 閱讀次數:3679次
相信在使用MSSQL數據庫下使用事務回滾方式操作多表記錄的時候,會經常出現“不能在手動或分布事務方式下創建新的連接”的出錯提示信息,這個問題也已困擾我多年。

  這次在開發一個大型的商務平臺的時候,涉及到數據的計算,同時也必須要多表更新(或刪除)。借助GOOGLE也沒找到一個真能解決的問題。以前收集過一個MSDN的說明,官方的提示必須,只有用SQL語句執行數據庫操作才能使用事務處理

  從官方提示上理解,事式處理中涉及到查詢(Select)時,會出現這種出錯提示。同時也應該與記錄指針(Cursors)有關聯。試著這樣的思路,將事務處理中原出現的Conn.Execute("select ... from ...")修改為使用rs.Open...命令打開記錄集,問題解決。

  
以下為引用的內容:
MSDN說明:
Tips for Working with Cursors
Some providers, such as SQL Server, implement a forward-scrolling, read-only (or 'firehose') cursor mode, meaning that they can efficiently retrieve data by keeping a connection open. When working with such providers, the connection could be blocked by another user's transaction. The following examples demonstrate scenarios
that result in errors.
dbConn.Open "DSN=SQLForum;UID=sa;PWD=;"
'Example 1
dbConn.BeginTrans
RS.Open "Select * FROM Message", dbConn
Set dbCmd.ActiveConnection = dbConn
Example 1: The problem is that the command object's ActiveConnection is being set to a connection that is forward-scrolling and in 'firehose' mode. This is the same connection involved in the batch mode. The error from the provider will only appear in the Err object, and it will return as unspecified. For example, with the ODBC
Provider, you will get "Unspecified error".

dbConn.Open "DSN=SQLForum;UID=sa;PWD=;"
'Example 2
RS.Open "Select * FROM Message", dbConn
dbConn.BeginTrans
Example 2: The problem here is that the connection is forward-scrolling and in firehose mode, so it cannot be put into transaction mode. The error returned in the Errors collection from the provider will indicate that it is operating in firehose mode, and can't work in transaction mode. For example, with the ODBC Provider against
Microsoft SQL Server, you will get the error "Cannot start transaction while in firehose mode".

dbConn.Open "DSN=SQLForum;UID=sa;PWD=;"
'Example 3
RS.Open "Select * FROM Message", dbConn
Set dbCmd.ActiveConnection = dbConn
dbConn.BeginTrans
Example 3: The problem here is that the connection is in forward-scrolling firehose mode, so it cannot also be involved in a batch mode. The error returned in the Errors collection from the provider will indicate that the transaction could not be started. For example, with the ODBC Provider against Microsoft SQL Server, you will get the error "Cannot start transaction because more than one hdbc is in use".
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产69精品久久久久999 | 欧美性小说 | 中文字幕在线观看一区二区三区 | 老司机免费福利视频 | 最新国产中文字幕 | 亚洲欧美日韩专区 | 欧美性受| 日本亚洲黄色 | 最近在线中文字幕免费版 | 久久一区二区三区不卡 | 久久人人澡人人爽人人爱 | 偷拍videosex | 亚洲欧美一级久久精品 | 欧美三级手机在线 | 香港三级吃孕妇奶水 | 高清免费国产在线观看 | 久久精品国产99久久99久久久 | 欧美一区二区三区久久综 | 五月丁香六月综合缴清无码 | 成人影院久久久久久影院 | 免费在线播放视频 | www在线播放 | 免费a级特黄国产大片 | xxx暴力xxx | 欧美色图 亚洲 | 亚洲另类在线观看 | 欧美日韩免费看 | 久久精品亚洲综合 | 国产精品嫩草影院视频 | 欧美色久| 国产精品久久久久亚洲 | 日本一区二区在线播放 | 欧美一级视频在线观看 | 最新中文字幕日本 | 国产乱码一区二区三区 | 国产性色视频在线高清 | 亚洲处破女www | 国产精品爱久久久久久久9999 | 美女福利视频一区二区 | 国产图色| 亚洲一区日韩一区欧美一区a |