开发者

VB6 "Invalid use of property" error where the code seems fine

I am having a very stran开发者_高级运维ge problem. First, the code.

Private Function ProcessRecord(ByVal rsDocs As ADODB.Recordset) As Variant

   Dim rsTemp As ADODB.Recordset
   rsTemp = rsDocs
   rsDocs = RemoveDuplicateDocs(rsTemp)

Exit Function

The error is occurring on the second line of the function, where rsTemp is set equal to rsDocs. It's saying: "Compile error: Invalid use of property". I've looked for information on this error elsewhere, and all the reports are cases where people either forgot an equal sign, or incorrectly added the "Set" command to the beginning of the line of code. This error makes no sense to me, because it was compiling fine before, and the changes I've made to this project are not even in the class that throwing the error. The code here is identical to the way it was before. Has anyone ever seen an error like this pop up for what seems to be no good reason? Thanks!


You need to use

set rsTemp = rsDocs

since rsTemp is an object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜