# Fixing the wrong error ?

**URL:** <https://forum.xojo.com/t/fixing-the-wrong-error/52215>\
**Category:** General\
**Created:** [January 31, 2020, 6:00pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215 "2020-01-31T18:00:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman\_Palardy](https://forum.xojo.com/user_avatar/forum.xojo.com/norman_palardy/32/169_2.png) [@Norman\_Palardy](https://forum.xojo.com/u/Norman_Palardy)\
**Post date:** [January 31, 2020, 6:00pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215/1 "2020-01-31T18:00:35Z")

</div>

try this  
new desktop project  
to window1 add the open event with this code

```auto
  db.Provider = "SQLOLEDB"
```

also add a new property

```auto
  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

```auto
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

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [January 31, 2020, 6:53pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215/2 "2020-01-31T18:53:10Z")

</div>

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 ?!?

![](https://www.dropbox.com/s/5cffnorwolw6qge/2020-01-31_18-44-36.png?raw=1)

![](https://www.dropbox.com/s/3wi8zny7w9hxgue/2020-01-31_18-49-47.png?raw=1)

---

<div class="post-metadata">

**Author:** ![Norman\_Palardy](https://forum.xojo.com/user_avatar/forum.xojo.com/norman_palardy/32/169_2.png) [@Norman\_Palardy](https://forum.xojo.com/u/Norman_Palardy)\
**Post date:** [January 31, 2020, 7:23pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215/3 "2020-01-31T19:23:27Z")

</div>

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

```auto
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

```auto
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](https://xojo.com/issue/59016)\>

---

<div class="post-metadata">

**Author:** ![anon20074439](https://forum.xojo.com/letter_avatar_proxy/v4/letter/a/ac8455/32.png) [@anon20074439](https://forum.xojo.com/u/anon20074439)\
**Post date:** [January 31, 2020, 7:35pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215/4 "2020-01-31T19:35:03Z")

</div>

[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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [April 29, 2021, 4:16pm UTC](https://forum.xojo.com/t/fixing-the-wrong-error/52215/5 "2021-04-29T16:16:27Z")

</div>


