I was trying to do converting sqlite query command into mysql,
I want to show the row field into a textfield. I am using the sample msql sample database.
dim rs as RecordSet
rs=mDB.SQLSelect("SELECT * FROM team WHERE ID = '"+ me.Cell(me.ListIndex, 0) +"'")
TextField1.Text = rs.Field("ID").StringValue
TextField2.Text = rs.Field("name").StringValue
rs.close
dim rs as RecordSet
rs=mDB.SQLSelect(“SELECT * FROM team WHERE ID = '”+ me.Cell(me.ListIndex, 0) +"’")
if rs <> nil then
if rs.RecordCount = 1 then
TextField1.Text = rs.Field(“ID”).StringValue
TextField2.Text = rs.Field(“name”).StringValue
end if
else
if mDB.Error= true then
MsgBox mDB.ErrorMessage
end if
end if
A recordset is usually only NIL if the SQL statement was malformed… OR if there was no connection to the database … and that is what sounds likely here…
Did you add error checking at the point you are attempting to connect to the database?
Are you sure the connection is no going out of scope? (a common error these days it seems)