那里能够找到VB的所有错误号对应的错误信息的?

michealin 2003-08-22 09:49:14
如上
...全文
80 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
xingnup 2003-08-22
  • 打赏
  • 举报
回复
MSDN有啊!
射天狼 2003-08-22
  • 打赏
  • 举报
回复
微的Visual系列带了一个Error Lookup查看错误信息的工具.
didishu0807 2003-08-22
  • 打赏
  • 举报
回复
说明:
Dim ErrADO As Error
dim M_Conn as new adodb.connection
didishu0807 2003-08-22
  • 打赏
  • 举报
回复
For Each ErrADO In M_Conn.Errors
SQLError = True
SQLErrorNumber = ErrADO.number
SQLErrorDescription = ErrADO.Description
SQLErrorState = ErrADO.SQLState
SQLErrorSource = ErrADO.Source
SQLNativeError = ErrADO.NativeError
Exit For
Next
MsgBox Err.number & Err.Description
jornet 2003-08-22
  • 打赏
  • 举报
回复
vb系统自带的系统对象err用来把捕作到的错误描述 出来
Err.Description
err.Number
TechnoFantasy 2003-08-22
  • 打赏
  • 举报
回复
首先要在Form中加入一个ListBox和CommandButton
在将下面的代码加入到form的代码窗口中。
Private Declare Function FormatMessage Lib "kernel32" _
Alias "FormatMessageA" (ByVal dwFlags As Long, _
lpSource As Any, ByVal dwMessageId As Long, _
ByVal dwLanguageId As Long, ByVal lpBuffer _
As String, ByVal nSize As Long, Arguments As _
Long) As Long
Private Declare Function GetLastError Lib "kernel32" _
() As Long
Private Declare Function CloseHandle Lib "kernel32" _
(ByVal hObject As Long) As Long

Const FORMAT_MESSAGE_FROM_SYSTEM = &H1000
Const FORMAT_MESSAGE_IGNORE_INSERTS = &H200

Private Sub Command1_Click()
Dim ErrID As Long
Dim astr As String
Dim bstr As String
Dim l As Long

astr = String$(256, 20)
'获得具体的错误信息
For ErrID = 0 To 8191
l = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM Or _
FORMAT_MESSAGE_IGNORE_INSERTS, 0&, ErrID, 0&, _
astr, Len(astr), ByVal 0)
If l Then
bstr = Left$(astr, InStr(astr, Chr(10)) - 2)
'将错误信息加入列表框
List1.AddItem Str(ErrID) + " " + bstr
End If
Next ErrID
End Sub
运行程序,点击Command1,错误代码和向对应的错误提示信息就全部列在ListBox中了。
lihonggen0 2003-08-22
  • 打赏
  • 举报
回复
MSDN上有

参考:
http://www.china-askpro.com/vbasic22.shtml

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧