Charly wrote:
> I have a problem,I have connected to mySql successfully. My problem is
> for example, when you log in it runs through this code fine and I get
> the correct results but....then when i log off and i log back in i get
> an error saying "Object invalid or not set".
Usually when this error occurs, an object has not
been set properly. In your case, something after
your first login is closing out your rdoQry object,
and it is not getting opened for the second attempt.
Do you Set rdoQry = Nothing anywhere in your code?
Do you 'close' rdoQry but not 'open' it again?
>
> ' setting up a remote data object query specifying the SQL statement
> to run.
> With rdoQry
> .name = "internetcafe" 'WHEN IT HITS THIS LINE
> FOR THE
> .SQL = "select * from member" 'SECOND TIME, I GET THE
> ERROR
> .RowsetSize = 1
> Set .ActiveConnection = cnMySql
> Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
> End With
>
> ' loops through the record set processing the records and fields.
>
> Do Until rdoRS.EOF
> With rdoRS
> counter = .rdoColumns.Count
>
> If ((.rdoColumns(0).Value = member.names) Or (.rdoColumns(1).Value
> = member.pass)) Then
> If (.rdoColumns(10).Value = 1) Then
> Me.Hide
> frmMain.Show
> logged = True
> Else
> Me.Hide
> frmCustomer.Show
> logged = True
> End If
> Exit Do 'get out of the do until loop
>
> Else
> logged = False
> End If
> rdoRS.MoveNext
> End With
>
> Loop
> If (logged = False) Then
> MsgBox "Please re-enter your details", vbOKCancel, "Internet Cafe"
> txtName.Text = ""
> txtPass.Text = ""
> End If
>
>
> rdoRS.Close ' close record set
> cnMySql.Close ' close connection to the database
>
> End Sub >> Stay informed about: connected to mySQL using RDO,having a problem,