日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

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

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

來源:程序員人生   發布時間:2013-11-18 10:01:12 閱讀次數:3684次
相信在使用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".
生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产不卡免费视频 | 性一区| 成人在线不卡 | 99精品在线视频观看 | 亚洲精品视频一区 | av片在线播放 | 欧美天堂在线 | 欧美九九 | 亚洲不卡视频 | 亚洲一区综合 | 激情久久av | 一区二区三区四区在线观看视频 | 一区二区日韩精品 | 九九看片 | 国产欧美日韩 | 国产精品久久久久永久免费观看 | 黄色免费视频在线观看 | 精品午夜久久 | 国产午夜精品一区二区三区欧美 | 国产视频久久久 | 久久99精品久久久久久噜噜 | 亚洲一区 中文字幕 | 99国产精品久久久久久久久久 | 麻豆一二区 | 国产精品xxxx| 最近中文字幕免费在线观看 | 成人在线免费网站 | 日本久久片| 国产婷婷色一区二区三区 | 毛片免费看网站 | 综合激情久久 | 日韩午夜精品 | 久久久久亚洲一区二区三区 | 免费国产精品视频 | 国产精品久久久久久久久久久久久 | 免费国产| 成年人在线播放 | 嫩草影院97.com | 国产91在线 | 中日 | 玖玖色资源 | 国产一区二区三区在线视频 |