下面是我的原代码,执行到几百行时老是出这种错误(一共几千行),每次出现错误的行数还不一样,请高手帮我看看!!Dim v() As String
Dim i As Long
v() = Split(RichTextBox2.Text, vbCrLf)
For i = 0 To UBound(v())If Left(v(i), 3) = "节点号" Then
strdian = Replace(v(i), " ", "")
strdian = Replace(strdian, "节点号=", "")
ElseIf Left(v(i), 7) = "设备IP地址1" Then
strIPAddr = Replace(v(i), " ", "")
strIPAddr = Replace(strIPAddr, "设备IP地址1=", "")ElseIf Left(v(i), 4) = "节点名称" Then
strNodeName = Replace(v(i), " ", "")
strNodeName = Replace(strNodeName, "节点名称=", "")
ac_Tmp1.Execute " insert into [设备IP对应表](IP,mingcheng,jiedianhao) values('" & strIPAddr & "', '" & strNodeName & "','" & strdian & "')"
End IfNext i
ac_Tmp1.Close
Dim i As Long
v() = Split(RichTextBox2.Text, vbCrLf)
For i = 0 To UBound(v())If Left(v(i), 3) = "节点号" Then
strdian = Replace(v(i), " ", "")
strdian = Replace(strdian, "节点号=", "")
ElseIf Left(v(i), 7) = "设备IP地址1" Then
strIPAddr = Replace(v(i), " ", "")
strIPAddr = Replace(strIPAddr, "设备IP地址1=", "")ElseIf Left(v(i), 4) = "节点名称" Then
strNodeName = Replace(v(i), " ", "")
strNodeName = Replace(strNodeName, "节点名称=", "")
ac_Tmp1.Execute " insert into [设备IP对应表](IP,mingcheng,jiedianhao) values('" & strIPAddr & "', '" & strNodeName & "','" & strdian & "')"
End IfNext i
ac_Tmp1.Close
解决方案 »
- 急急~100分求 新电脑安装vb6.0后,sscommand控件 提示:该部件的许可证信息没有找到许可证使.在设计环境中,没有合适的用该功能
- 高分请做个题目!VB
- 如何禁止mdi窗体最小化和最大化
- vsflexgrid如何按某列排序?
- ODBC数据源连接sql server数据库时出现了问题?(请各位帮帮忙!Thank you!)
- microsoft招人的面试题一道
- Ctrl和Alt之间那个WINDOWS键的ASCII码和VBCODE各是多少?
- 请问哪里可以下载OfficeXP?
- 各位前辈介绍几本好书。
- 我用vb跟access2000连接的问题???急啊!!!!!!!11
- VB如何让发送的链接与IE的cookie同步
- 求助! vb6.0 怎样用datagrid控件中显示文本数据
确定SQL语句正确.
确定数组下标未超出.
确定引用对象有初始化.
v() = Split(RichTextBox2.Text, vbCrLf)
For i = 0 To UBound(v()) 改为
v = Split(RichTextBox2.Text, vbCrLf)
For i = 0 To UBound(v) 其它的类似
v = Split(RichTextBox2.Text, vbCrLf) For i = 0 To UBound(v)
If Left(v(i), 3) = "节点号" Then
strdian = Replace(v(i), " ", "")
strdian = Replace(strdian, "节点号=", "")
ElseIf Left(v(i), 7) = "设备IP地址1" Then
strIPAddr = Replace(v(i), " ", "")
strIPAddr = Replace(strIPAddr, "设备IP地址1=", "")
ElseIf Left(v(i), 4) = "节点名称" Then
strNodeName = Replace(v(i), " ", "")
strNodeName = Replace(strNodeName, "节点名称=", "")
End If
Next iac_Tmp1.Execute " insert into [设备IP对应表](IP,mingcheng,jiedianhao) values('" & strIPAddr & "', '" & strNodeName & "','" & strdian & "')"
ac_Tmp1.Close
S = Split(RichTextBox2.Text, vbCrLf)
Redim Preserve v(UBound(S)) As StringFor i = 0 To UBound(S)
v(i)是你的每一个数组的内容
Next i
For i = 0 To UBound(S)
v(i)=s(i)
v(i)是你的每一个数组的内容 或你直接用 s(i)
Next i
dim str1 as string
……
str1=" insert into [设备IP对应表](IP,mingcheng,jiedianhao) values('" & strIPAddr & "', '" & strNodeName & "','" & strdian & "')"
debug.print str1