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

[code] app.myDbase.host=“127.0.0.1”
app.myDbase.port=3306
app.myDbase.databaseName=“TEST”
app.myDbase.userName=fldUsername.Text
app.myDbase.Password=fldPassword.text

If app.myDbase.Connect() then
session.Cookies.Set(“username”,fldUsername.Text)
session.Cookies.Set(“password”,fldPassword.Text)
webpage1.show
else
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"
rs=app.myDbase.SQLSelect(sql)

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

//Load Listbox here

else
MsgBox “db failed”
end if

[/code]

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.