Forums
This topic is locked
The Update Record Behavior Syntax Error
04 Sep 2001 23:20:30 B. B. posted:
Hello! Have an error condition with this behavior that is stopping the record update from completing.Looked it up on the MM tech notes but their solution does not look to meet the specific parameters with this page.
Here is the generated recordset SQL code.
SELECT UserName, Week1, WinnerID
FROM Winners_Table
WHERE UserName = 'MMColParam'
MMColParam is set from a session variable that has the username value received at logon. The Week1 column is the column to be updated with a user selected drop down text
value from the update form. The WinnerID is an autonumber defined field on the Winner table that is the primary key.
Here is the error from the page.
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in
query expression 'WinnerID = , Joe T15., 10'.
Cannot find in the code view the actual SQL that is submitted since it must resolve it with the variable values when the Update button is clicked.
The Joe T15. is the username and 10 is the WinnerID retrieved from the recordset which brings back one record which is correct.
Now in viewing the code it looks like the generated recordset code is placed
after the update record generated code. Do not know why UD4 did that but with it being a top down run scripting language, ASP, that might be a possible correction point but not sure yet.
The WinnerID field is the Unique Key Column field needed in the Update Record dialog box and it is checked as numeric.
Not sure what else to check at this point so any recommendations would be appreciated very much. Thanks!
Replies
Replied 05 Sep 2001 02:00:26
05 Sep 2001 02:00:26 Owen Eastwick replied:
I think your problem is due to the fact that you ar tryng to SELECT Week1, which I assume at the point you are trying to retrieve it is empty or Null, try just selecting the WinnerID with your SQL:
SELECT WinnerID
FROM Winners_Table
WHERE UserName = 'MMColParam'
Then use the Update Record Server Behaviour, it should pick up WinnerID as the Unique Key Column.
Regards
Owen
www.tdsf.co.uk/tdsfdemo
SELECT WinnerID
FROM Winners_Table
WHERE UserName = 'MMColParam'
Then use the Update Record Server Behaviour, it should pick up WinnerID as the Unique Key Column.
Regards
Owen
www.tdsf.co.uk/tdsfdemo
Replied 05 Sep 2001 05:12:18
05 Sep 2001 05:12:18 B. B. replied:
Hey Owen! Was in the middle of updating the
page per your recommendation but then realized that this condition is different than what you thought in your post.
The Week1 column is already valued and this is the column that will be updated upon getting the update behavior coded correctly.
This column was included in the original recordset but it is displayed on the page to indicate to the users what is the current value of this column.
Could do it your way if add another recordset which would not select the Week1 column. However, not sure of the efficiency aspects of basically retrieving the same recordset back to back in the code. Would that slow down processing time going back to the server like that? If not then will try your code tip on the page.
Will appreciate any more insight that you may have. Thanks!
page per your recommendation but then realized that this condition is different than what you thought in your post.
The Week1 column is already valued and this is the column that will be updated upon getting the update behavior coded correctly.
This column was included in the original recordset but it is displayed on the page to indicate to the users what is the current value of this column.
Could do it your way if add another recordset which would not select the Week1 column. However, not sure of the efficiency aspects of basically retrieving the same recordset back to back in the code. Would that slow down processing time going back to the server like that? If not then will try your code tip on the page.
Will appreciate any more insight that you may have. Thanks!
Replied 05 Sep 2001 05:27:50
05 Sep 2001 05:27:50 Owen Eastwick replied:
No, don't add another recordset.
Re-readig your original post, I think it's a problem with the update.
First get rid of the Update Record behaviour and check that the fields display on the page OK.
Once that's sorted add the behviour again.
QUESTION - are you displaying Week1 in a text box which is then picked up as the source of input by the Update Record behaviour?
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Edited by - oeastwick on 09/05/2001 05:28:58
Re-readig your original post, I think it's a problem with the update.
First get rid of the Update Record behaviour and check that the fields display on the page OK.
Once that's sorted add the behviour again.
QUESTION - are you displaying Week1 in a text box which is then picked up as the source of input by the Update Record behaviour?
Regards
Owen.
Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Edited by - oeastwick on 09/05/2001 05:28:58
Replied 05 Sep 2001 05:46:51
05 Sep 2001 05:46:51 B. B. replied:
Hey! Have deleted the update behavior and removed from the recordset the Week1 column.
Added the update behavior back and the same error still appears as in the original post.
The Week1 column is being updated from a Select drop down with various options and of which the selected one is passed to hopefully update the table.
It is a one field form which has the above mentioned select drop down along with a button for initiating the update action on this page.
The form elements in the Update ecord dialog box has select updates column "Week1" (Text) and then a hidden field which is ignored at this point but will actually be a date when this is finished.
Hope this information helps. Thanks!
Added the update behavior back and the same error still appears as in the original post.
The Week1 column is being updated from a Select drop down with various options and of which the selected one is passed to hopefully update the table.
It is a one field form which has the above mentioned select drop down along with a button for initiating the update action on this page.
The form elements in the Update ecord dialog box has select updates column "Week1" (Text) and then a hidden field which is ignored at this point but will actually be a date when this is finished.
Hope this information helps. Thanks!
Replied 07 Sep 2001 10:01:59
07 Sep 2001 10:01:59 B. B. replied:
Hey! Have still not had any luck with this yet.
This page has additional behaviors such as log out user and restrict access and was wondering if maybe the order in which they were added would be causing the update error
to occur here.
It should be a simple and straightforward update but for whatever reason it is not. The next step might be to build a whole new page and put the behaviors in a different order if that is necessary. Wanted to check for other recommendations first before doing that. Thanks!
This page has additional behaviors such as log out user and restrict access and was wondering if maybe the order in which they were added would be causing the update error
to occur here.
It should be a simple and straightforward update but for whatever reason it is not. The next step might be to build a whole new page and put the behaviors in a different order if that is necessary. Wanted to check for other recommendations first before doing that. Thanks!
Replied 21 Sep 2001 17:50:07
21 Sep 2001 17:50:07 B. B. replied:
Hello! Finally got this thing to work. The error was resulting from the Username containing a special character which was a period.
There are special characters that SQL does not like and the generated SQL was not working due to the period. The error was indicating a syntax error but stated missing operator so that was the research focus. While performing more testing and getting some further help about error possibilities the period was removed from the Username and it worked.
For future reference hope this helps. Thanks!
There are special characters that SQL does not like and the generated SQL was not working due to the period. The error was indicating a syntax error but stated missing operator so that was the research focus. While performing more testing and getting some further help about error possibilities the period was removed from the Username and it worked.
For future reference hope this helps. Thanks!