日期:2014-05-18  浏览次数:20564 次

请教关于sql2000错误号的问题
各位高手,我碰到一个疑难问题,就是我通过odbc向后台发送语句,执行失败了,由于不同的错误原因我将会有不同的处理方式,所以我想知道:如何判断是由于网络断开的原因。我也尝试用aerror()来获取错误号(我用的是vfp,得出的错误号是10054和01000),我就无法知道到底以哪个来判断是断开连接了。可是不能肯定这样是否正确,不知有没有朋友有这方面的经验,请指教。

------解决方案--------------------
http://msdn2.microsoft.com/en-us/library/aa937495(SQL.80).aspx

Error 10054 (DB-Library):
http://msdn2.microsoft.com/en-us/library/aa937499(SQL.80).aspx

Windows Sockets Error Codes 10054
Connection reset by peer.
An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.
http://msdn2.microsoft.com/en-us/library/ms740668.aspx

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=625485&SiteID=1