运行时错误5 [英] RunTime Error 5

查看:113
本文介绍了运行时错误5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有理由我继续得到这个运行时错误,我从来没有

之前得到它。有人可以帮我解决这个问题吗?这是我的代码:


rstout

''首先检查是否不在EOF

如果不是(rstin.EOF)然后

rstin.MoveFirst

''循环遍历所有记录rstIN(表tblPhongParseIN)

做的时候没有rstin.EOF

''将strField1设置为tblPhongParseIN Field1

strField1 = rstin(" ID")

cutstring = Left([strField1],InStr([strField1], "") -

1)< ------这是我收到错误的地方。

strfield4 = rstin(" amt_issued")


谢谢你。

Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:

With rstout
''first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
''loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
''set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")

THank you.

推荐答案

ph ******* @ gmail.com 写道:
有没有理由为什么我一直得到这个运行时错误,我从来没有得到它。有人可以帮我解决这个问题吗?这是我的代码:

rstout
''首先检查一下是否不在EOF
如果不是(rstin.EOF)那么
rstin.MoveFirst
''循环遍历所有记录rstIN(表tblPhongParseIN)
Do While Not rstin.EOF
''将strField1设置为tblPhongParseIN Field1
strField1 = rstin(" ID")
cutstring = Left([strField1],InStr([strField1],"") -
1)< ------这是我得到错误的地方。
strfield4 = rstin( amt_issued)

感谢你。
Is there a reason why i keep getting this run time error, i never
gotten it before. Can someone help me out with this? here is my code:

With rstout
''first check if not on EOF
If Not (rstin.EOF) Then
rstin.MoveFirst
''loop through all the records rstIN (table tblPhongParseIN)
Do While Not rstin.EOF
''set strField1 to tblPhongParseIN Field1
strField1 = rstin("ID")
cutstring = Left([strField1], InStr([strField1], " ") -
1)<------This is where i get the error.
strfield4 = rstin("amt_issued")

THank you.




Phong,


当我尝试MsgBox时(左(我的文字,-1)),我收到错误信息5.

似乎暗示 "在[strField1]中找不到导致

-1出现在Length参数中。另外,假设strField1是声明为字符串的
,那么

周围不应该有任何方括号。也许Access正在寻找Me.strField1,因为方括号

括号。无论如何,MsgBox(*& strField1&" *")看它是否包含

空白与否。我也不明白为什么你需要一个 "在

''ID'字段中。或许使用If..Then..Else是否

InStr(strField1,"")= 0.


James A. Fortune



Phong,

When I try MsgBox (Left("My Text", -1)), I get error message 5. That
seems to suggest that " " is not being found in [strField1] causing a
-1 to show up in the Length argument. Also, assuming strField1 is
declared to be a string, there shouldn''t be any square brackets around
it. Maybe Access is looking for Me.strField1 because of the square
brackets. Anyway, MsgBox("*" & strField1 & "*") to see if it contains
a blank or not. I also don''t see why you need to require a " " in an
''ID'' field. Perhaps use an If..Then..Else on whether or not
InStr(strField1, " ") = 0.

James A. Fortune


感谢您的回复。我只是想把这个字符串解析成

字段。


i有一个看起来像这样的字段


Field 1

12345678 MASS

Field 2

; 2; 3; 3; 5; 08/01/2014; 3; 100.0000 ; 2; 1395000.00; 5; 08/01/2015; 3; 100.0000; 2; 1475000.00; 5; 08/01/2016; 3; 100.0000; 2; 1555000.00;


i 我只是试图在没有MASS部分的情况下解析第一个字段,而第二个字段是我试图解析除了DATE

和PRICE字段之外的所有内容。请指教。

Thanks for the reply. i''m just trying to parse this string into
fields.

i have a field that looks like this

Field 1
12345678 MASS
Field 2
;2;3;3;5;08/01/2014;3;100.0000;2;1395000.00;5;08/01/2015;3;100.0000;2;1475000.00;5;08/01/2016;3;100.0000;2;1555000.00;

i''m just trying to parse field one without the MASS section, and the
second field i was trying to parse out everything except for the DATE
and the PRICE field. Please advise.


有时候第一个字段的长度超过9个字符。所以我想我只是在寻找一个更好的解析第一个没有轰炸的场地。

谢谢。

sometime field one has more then 9 characters long. So i guess i''m
just looking for a better to parse field one without it bombing.
thanks.


这篇关于运行时错误5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆