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$)
精彩评论