Hyarion
10-25-2004, 03:00 AM
I've made some major modifications to my program, one of them being the whole user registration.
The problem I'm having is when I try update a record (of a mysql database on a server) it gives me an error. I don't understand why as I don't think I've done anything wrong and if I change the recordsets to a MS Access database (not server) it works fine. Anyone got any ideas?
Error -2147467259: "Query-based Update Failed because the row to update could not be found."
Public Sub NUActivate()
Dim UpSQL1 As String
Dim UpSQL2 As String
'activates the new user.
ConnectMySQL
If MySQLError = True Then
'go to error screen
SSTab1.TabEnabled(5) = True
SSTab1.Tab = 5
SSTab1.TabEnabled(1) = False
lblError.Caption = "An Error has occurred trying to Save your details. " & _
"Please make sure you are connected to the internet and try again. " & _
"if the problem persists, please contact technical support."
cmdTryAgain.Tag = "2"
CmdBack.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
DisconnectMySQL
Exit Sub
End If
gPrs.Open "SELECT * FROM Users WHERE User_ID=" & sqlUserID, gCnn, adOpenForwardOnly, adLockOptimistic
If MySQLRecordCount("Users", "User_ID=" & sqlUserID) <= 0 Then
'no records, unsuccessful activation
cmdTryAgain.Tag = 0
SSTab1.TabEnabled(5) = True
SSTab1.Tab = 5
SSTab1.TabEnabled(1) = False
lblError.Caption = "Error: Your User Account cannot be found." & vbCrLf & _
"Please try again or contact technical support."
CmdBack.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
gPrs.Close
DisconnectMySQL
Exit Sub
End If
'if here then ready to save details.
SSTab1.TabEnabled(3) = True
SSTab1.Tab = 3
SSTab1.TabEnabled(2) = False
Command1.Enabled = False
CmdBack.Enabled = False
Command3.Enabled = False
DoEvents
adOpenDynamic, adLockOptimistic
For z = 0 To 5
gPrs(txtUDetails(z).Tag).Value = txtUDetails(z)
Next
gPrs.Update
gPrs.Close
DisconnectMySQL
The problem I'm having is when I try update a record (of a mysql database on a server) it gives me an error. I don't understand why as I don't think I've done anything wrong and if I change the recordsets to a MS Access database (not server) it works fine. Anyone got any ideas?
Error -2147467259: "Query-based Update Failed because the row to update could not be found."
Public Sub NUActivate()
Dim UpSQL1 As String
Dim UpSQL2 As String
'activates the new user.
ConnectMySQL
If MySQLError = True Then
'go to error screen
SSTab1.TabEnabled(5) = True
SSTab1.Tab = 5
SSTab1.TabEnabled(1) = False
lblError.Caption = "An Error has occurred trying to Save your details. " & _
"Please make sure you are connected to the internet and try again. " & _
"if the problem persists, please contact technical support."
cmdTryAgain.Tag = "2"
CmdBack.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
DisconnectMySQL
Exit Sub
End If
gPrs.Open "SELECT * FROM Users WHERE User_ID=" & sqlUserID, gCnn, adOpenForwardOnly, adLockOptimistic
If MySQLRecordCount("Users", "User_ID=" & sqlUserID) <= 0 Then
'no records, unsuccessful activation
cmdTryAgain.Tag = 0
SSTab1.TabEnabled(5) = True
SSTab1.Tab = 5
SSTab1.TabEnabled(1) = False
lblError.Caption = "Error: Your User Account cannot be found." & vbCrLf & _
"Please try again or contact technical support."
CmdBack.Enabled = False
Command1.Enabled = False
Command3.Enabled = True
gPrs.Close
DisconnectMySQL
Exit Sub
End If
'if here then ready to save details.
SSTab1.TabEnabled(3) = True
SSTab1.Tab = 3
SSTab1.TabEnabled(2) = False
Command1.Enabled = False
CmdBack.Enabled = False
Command3.Enabled = False
DoEvents
adOpenDynamic, adLockOptimistic
For z = 0 To 5
gPrs(txtUDetails(z).Tag).Value = txtUDetails(z)
Next
gPrs.Update
gPrs.Close
DisconnectMySQL