 |
 |

07-14-2003, 01:50 AM
|
|
Newcomer
|
|
Join Date: Jul 2003
Location: Netherlands
Posts: 3
|
|
syntax error in FORM clause
|
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,
|
|

07-14-2003, 07:27 AM
|
 |
Centurion
|
|
Join Date: Apr 2003
Location: Birmingham, AL
Posts: 165
|
|
Quote: Originally Posted by Ossenaar 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?
|
__________________
I was just checkin' the...uh...specs on the..uh.. inline rotary..gu...I'm retarded. [I]-Chris Farley-Tommy Boy
|

07-14-2003, 08:01 AM
|
|
Newcomer
|
|
Join Date: Jul 2003
Location: Netherlands
Posts: 3
|
|
Quote: Originally Posted by 2bNvUs
Quote: Originally Posted by Ossenaar 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
|
|

07-14-2003, 08:28 AM
|
 |
Centurion
|
|
Join Date: Apr 2003
Location: Birmingham, AL
Posts: 165
|
|
Code:
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
[B][I]Set RS1 = Nothing[/I][/B]
End If
RS1.Open ("SELECT * FROM [Medewerkers] WHERE ([Medewerkers.emno] = " & txtMedew.Text & ")")
txtCWTT.Text = LTrim(RTrim(RS1.Fields("cwtt")))
RS1.Close
Set RS1 = Nothing
|
__________________
I was just checkin' the...uh...specs on the..uh.. inline rotary..gu...I'm retarded. [I]-Chris Farley-Tommy Boy
|

07-14-2003, 11:53 AM
|
|
Centurion
|
|
Join Date: Dec 2002
Location: Here I am!
Posts: 184
|
|
Quote: Originally Posted by 2bNvUs
Code:
Set RS1 = deGenUrex.rsMedewerkers
If RS1.State = adStateOpen Then
RS1.Close
[B][I]Set RS1 = Nothing[/I][/B]
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....
|
__________________
"Whom are you?" said he, for he had been to night school.
-- George Ade
"A long memory is the most subversive idea in America."
-- Unknown
|

07-14-2003, 12:05 PM
|
 |
Centurion
|
|
Join Date: Apr 2003
Location: Birmingham, AL
Posts: 165
|
|
|
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.)
|
__________________
I was just checkin' the...uh...specs on the..uh.. inline rotary..gu...I'm retarded. [I]-Chris Farley-Tommy Boy
|

07-15-2003, 03:05 AM
|
|
Newcomer
|
|
Join Date: Jul 2003
Location: Netherlands
Posts: 3
|
|
Quote: Originally Posted by 2bNvUs 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
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|