开发者

VB 6 pass argument As Database to function - type mismtach

I try to pass argument to function (Visual Basic 6)

Dim oDB As Database .. oDB = OpenDatabase(databaseName$)

SampleFunction(oDB) ' here error type mismatch

..

Function SampleFunction(ByRef oDB As Database)

' oDB.TableDefs("tableName")

End Function

How can I pass开发者_如何学Python this argument correctly?

Thanks


The problem is not located in the Database, but in the call to the SampleFunction:

Either write:

Call SampleFunction(oDB)

or:

SampleFunction oDB

or:

Dim x
x=SampleFunction(oDB)

By the way: you are much better off by first going to sites like www.vb6.us or visualbasic.freetutes.com


One thing might be that you need to use Set

Set oDB = OpenDatabase(databaseName$)
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜