Error 1046 MySQL - No Database Selected

I am trying to log into a local MySQL database using a web app.

I am sure the credentials are correct, since I can log in using SequelPro without a problem.

The error I get is “1046 - No Database Selected” however there is a value entered for app.myDbase.databaseName


If app.myDbase.Connect() then
MsgBox “Connection failed!”+ chr(13) + app.myDbase.ErrorMessage
end if[/code]

In the open event for webpage1 is the following code:

[code] Dim sql as string

if app.myDbase.Connect then

Dim lb as WebListBox = Listbox1

//rs is set as a property of the window webpage1 so you don't have to DIM it

//select all patients
sql = "SELECT * FROM customers ORDER BY Last_Name ASC, First_Name ASC LIMIT 50"

If app.myDbase.Error then
  MsgBox app.myDbase.ErrorMessage  //<---- this is where the error occurs
End if

//Load Listbox here

MsgBox “db failed”
end if


Is there something obvious that I am missing?

Having a “name” doesn’t mean you have a “connection”
where are you defining myDbase? perhaps it is going out of scope

The problem is that you need a separate connection per session. Move myDbase from the app class to the Session class.