try this
new desktop project
to window1 add the open event with this code
db.Provider = "SQLOLEDB"
also add a new property
db as ADODB.Connection
try and run
note that you get an odd error about
[quote] Type “SQLite.Connection” has no member named “Provider”
db.Provider = “SQLOLEDB”
[/quote]
and later on one about
[quote] Can’t find a type or module with this name
db AS ADODB.Connection
[/quote]
if you “fix” the error that is listed first you may in fact fix the wrong thing
In a large program this may be even more obscured
but if you make your code (which is NOT the exact equivalent but serves to illustrate the issue
Dim db As adodb.connection
db.Provider = "SQLOLEDB"
you now get the “cant find type with this name” error first and if you fix that the second one may go away
not sure the compiler can do anything about this to order errors
hence why I’ve not put in a feature request or bug report yet
Move the declaration error up?
I’d also be concerned with the 2nd error randomly highlighting B.Con or seemingly the 19th character until three characters after the full stop ?!?


yeah in this case the second error is definitely the one to fix
but I do not have the option to move the decl - the declaration isnt one I wrote
It’s a property I added to the window
the fact that manually writing the code with the decl first orders the errors in the “right” way suggests the IDE may be writing the window code for the compiler as
Window
Event Open()
db.Provider = "SQLOLEDB"
End Event
db As adodb.connection // user defined property on Window1
end Window
and if it wrote it as
Window
db As adodb.connection // user defined property on Window1
Event Open()
db.Provider = "SQLOLEDB"
End Event
End Window
then the cant find a type with this name would be the first error not the second
<https://xojo.com/issue/59016>
[quote=473561:@Norman Palardy]but I do not have the option to move the decl - the declaration isnt one I wrote
It’s a property I added to the window[/quote]
Aye I meant for the IDE to move the error up 