Eddies Electronics for MySQL

I have a new project that I want to setup similar to how Eddies Electronics is setup, where everything is referenced thru a database class, but I want to use MySQL instead of sqlite.

I can get the class setup, and I create a method called OpenDatabase, but in my main page I do a TheDatabase.OpenDatabase but I get an error about "static reference to instance method: call this on an instance of class TheDatabase

The “TheDatabase” is being used in the project rather than “OrdersDatabase” that’s in the EE project.

Does anyone happen to have a copy of the EE web project but converted to use MySQL that I could get?

I’m trying to do the work myself but have been stuck on this for a few hours now.

I’m making a bit of progress, so don’t spend much time on it. I’m learning.

By the looks of things you’ve created a class called TheDatabase which has a method OpenDatabase. To use that class you need to create an instance. You can use for example

Dim OrdersDatabase As New TheDatabase OrdersDatabase.OpenDatabase

You will need to watch scope. The above code will only hold that database instance for that method. To make the database available across your project add a module with a property OrdersDatabase As TheDatabase and use

OrdersDatabase = New TheDatabase OrdersDatabase.OpenDatabase