Tuesday, August 31, 2004

My Web Project Adventure

I have finished my part of web application project. It is a Online Campus System. The modules I handled are :
  1. Exercise / Examination - create, edit, delete and view exercise / exam details. It allows objective and fill in the blank type of question.
  2. Exam - Participate on particular exercise /exam. Answers would be verified by system automatically and show result. Students' level would be upgraded if he pass particular exam.
I was using VFP 8 OLEDB to access VFP table from ASP. It works quite well, except I failed to delete records from table exam - "Trigger Failed in ... ". In this table, I have stored procedure to do cascade delete. This stored procedure is generated by TaxRI.

At first, I suspected that exam has been participated by any student (business rule). However, that is nobody. Also, I can delete that exam from VFP command window without error. I tried to get helps from UT forum, Foxite.com, Tek-Tips.com, FoxAdvisor forum and also search from Yahoo and Google. I just can't get any related information.

After spent few hours for research without any solutions, I decided to write a VFP COM DLL which only contains code to delete record as workaround. Here I get another error message - "Operation is invalid for a Memo, Blob, General, or Picture field". My God!!!! What is that??? My Primary Key is an integer field. Is it problem of table structure? Since I use VFP9 to create the table, but I didn't use any new VFP9 field type. I tried to rebuild my tables but still the same.

Finally, I found that the parameter passed from ASP is object data type. Huh? Why object? Request.QueryString("myField") alway return string, doesn't it? Thank you for article Using VFP COM components with Active Server Pages by Rick Strahl.

In fact, in order to pass value of Request.QueryString() to the world outside of ASP, we got to Request.QueryString("myField").Item(). I changed my ASP code and it works.

Here is the database and ASP code to re-produce the error. Pls feel free to download and try it. If you found the cause, pls comments. Thank you.

After this project, I really feel that ASP.NET is the tool should go for web development. It provides various web control, support OOP for re-use. Design Web UI and writing ASP scripting language is really painful and time consuming.

I really hope VFP supports web development natively. Then, that may less headache for VFP developer. Alternately, there are some third party VFP Web Development framework such as, WebConnect, ActiveVFP, Voodoo, and Active FoxPro Pages which have very good comments from VFP community.

0 Comments:

Post a Comment

<< Home