Ossenaar
07-14-2003, 01:50 AM
Hello,
I have an problem with the following sql-statement.
Private Sub Form_Activate()
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
End Sub
When I login for the first time the sql-statement works, but when I logout an login with an other user I get error message:
"Run-time error '-2147217900 (80040e14)':
Syntax error in FORM clause."
What did I do wrong?
Is there someone who can help me?
Thanks in advance.
Best regards,
2bNvUs
07-14-2003, 07:27 AM
Hello,
I have an problem with the following sql-statement.
Private Sub Form_Activate()
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
End Sub
When I login for the first time the sql-statement works, but when I logout an login with an other user I get error message:
"Run-time error '-2147217900 (80040e14)':
Syntax error in FORM clause."
What did I do wrong?
Is there someone who can help me?
Thanks in advance.
Best regards,
When you say login, what do you mean? Login to the program that you are working on?
Ossenaar
07-14-2003, 08:01 AM
Hello,
I have an problem with the following sql-statement.
Private Sub Form_Activate()
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
End Sub
When I login for the first time the sql-statement works, but when I logout an login with an other user I get error message:
"Run-time error '-2147217900 (80040e14)':
Syntax error in FORM clause."
What did I do wrong?
Is there someone who can help me?
Thanks in advance.
Best regards,
When you say login, what do you mean? Login to the program that you are working on?
2bNvUs,
Yes, I have made a program for several users. And with there login-code they activate the program.
Ossenaar
2bNvUs
07-14-2003, 08:28 AM
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
Set RS1 = Nothing
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
xamua
07-14-2003, 11:53 AM
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
Set RS1 = Nothing
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
why would you tell him to set the object to nothing and then to try to use that same object again a couple lines later?
if txtMedew.Text is NOT a numeric value it needs single quotes around it in the SQL
and this is clearly not ASP....
2bNvUs
07-14-2003, 12:05 PM
Well, if it is open already, then the If statement tells it to close and set it to nothing, It then proceeds to open it again, so that it is not trying to open a connection that is already open. The program has a log in and logout, he said that the Query worked the first time but not after that. That is why I thought it could be that he is not setting the RS1 to nothing first before trying to reopen it (without closing the app.)
Ossenaar
07-15-2003, 03:05 AM
Well, if it is open already, then the If statement tells it to close and set it to nothing, It then proceeds to open it again, so that it is not trying to open a connection that is already open. The program has a log in and logout, he said that the Query worked the first time but not after that. That is why I thought it could be that he is not setting the RS1 to nothing first before trying to reopen it (without closing the app.)
2bNvUs,
Your solutions didn't work, but thanks anyway. The problem is solved.
Ossenaar