Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

connected to mySQL using RDO,having a problem,

 
   Database Help (Home) -> Visual Basic RSS
Related Topics:
DMO - detachDB problem - I have the following code: Set oServer = New ServerID, ServerPwd Set oDatabase = Call True) however, I continue getting the following error:

Access 2002 Automation problem with OpenReport - My VB 6 needs to print a report in an Access 2002 database. This was working fine when I used Access 97 but now the quits without any errors on the line. I have my VB set to access 10.0. ..

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table and there a column wich is data type All data in this column is in form So why when i run .asp page with simple query to..

arrays - is there a way to the contents of an array (looping through the array) and storing each item in a comma delimited string? Thanks!

DataReport PageBreak - Hi everyone, I would like to know how to force pagebreak in a for example after 5 records printed. Thank you all
Next:  files are copying themselves when being deleted  
Author Message
Charly

External


Since: Feb 12, 2005
Posts: 1



(Msg. 1) Posted: Sat Feb 12, 2005 7:05 am
Post subject: connected to mySQL using RDO,having a problem,
Archived from groups: comp>lang>basic>visual>database (more info?)

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".

' 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, 
Back to top
Login to vote
charly

External


Since: Feb 12, 2005
Posts: 1



(Msg. 2) Posted: Sat Feb 12, 2005 8:57 am
Post subject: Re: connected to mySQL using RDO,having a problem, [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Im after setting rdoQry to nothing and it seems to be working!! Thanks
a million! I'll be back if it doesnt continue! Thanks again!!

 >> Stay informed about: connected to mySQL using RDO,having a problem, 
Back to top
Login to vote
Randy Day

External


Since: Oct 06, 2003
Posts: 50



(Msg. 3) Posted: Sat Feb 12, 2005 10:43 am
Post subject: Re: connected to mySQL using RDO,having a problem, [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: connected to mySQL using RDO,having a problem, 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]