Creating a Web Poll in Flash MX 2004: Pt. 2 Support Product Page

This topic was archived

updateDatabase.aspx

Asked 02 Feb 2005 11:00:37
1
has this question
02 Feb 2005 11:00:37 karan chander posted:
hi,
i was trying out the poll and everything seems to be working fine barring the update database part. i get the following error with the updateDatabase.aspx file when i run it.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Syntax error in UPDATE statement.

on this line,
Line 33: DBCommand.ExecuteNonQuery

with the above line present, the file updateDatabase.aspx fails to load. without the line the file opens but it doesnt update the database, which is fairly obvious.
im guessing the above line should have some sort of try catch statements for it to work. any help would be much appriciated.

karan

Replies

Replied 02 Feb 2005 11:08:14
02 Feb 2005 11:08:14 Sas Jacobs replied:
Hi Karan

Thanks for the post. Yes, there could have been some error handling added to the code but I thought that might confuse things for the non-developers out there.

I'm guessing you opened the file in a Web browser and tried to run it directly. Have you changed the booDebug variable in the file to true? If not, you'll get an error very much like the one you indicate below. This places the page in test mode, where the response of Dreamweaver will be recorded along with a count of 400.

Otherwise, you can't run the file through a Web browser as it will expect the values to be sent from an HTTP post i.e. from Flash, and you'll get an error.

Can you confirm that this is how you're testing the file?

Cheers

Sas
Replied 02 Feb 2005 11:29:48
02 Feb 2005 11:29:48 karan chander replied:
hey Sas,
thanks for the prompt reply. well i tried the booDebug set to true, yet still the database is not updated.
well i am running on xp pro with iis 5 or 6(not sure there). with asp 1.1 support. well i run the swf from my ie explorer. the database values are read perfectly and any changes i make are reflected back to the poll without a hitch. but when i press the vote button, the flash movie gets updated but the database value remains the same.
the same happens when i run the fla inside flash itself (cntrl + return), but in this case i get an error in the output window. ill paste it for you to have a look at.
Error opening URL "localhost/poll/updateDatabase.aspx"
failed
Replied 02 Feb 2005 12:21:11
02 Feb 2005 12:21:11 karan chander replied:
problem solved,
it was to do with the write permissions in the database. works like a breeze. cheers.
karan!
Replied 02 Feb 2005 12:32:59
02 Feb 2005 12:32:59 Sas Jacobs replied:
Hi Karan

It's great that you fixed the problem. There are so many things that can go wrong when you start working with server side code that it can be hard to know where to start when you are debugging!

Cheers

Sas

Reply to this topic