Parse CSV Issue

After doing a lot of searching on how to best parse a CSV for input into a database, most of the comments pointed to the work found on the http://www.great-white-software.com/REALbasic_Code.html site. From what I can see looking through the code, it is exactly what I need.

Now for the issue: This code is for a web application and when I drag the CSVParser class onto the container (just like in the sample app) and launch it, I get the error “cannot be cast to WebPage” when attempting to display the container the CSVParser is in. At this point I’ve not used any of the functionality, only attached it to the container. As soon as I remove the CSVParser class and launch the application, everything works great again

I’ve looked through the code and I can’t see anything that would be stopping the loading of the page/container. Does anyone have experience porting this excellent work to a web application?

Thank you in advance…

unzip the CSVParser.zip project
drag the classes

CSVField.rbo CSVParser.rbo CSVRecordSet.rbo
into your web project
drag an instance of CSVParser to your web layout
run

worked dandy here
there’s no UI to the parser itself

and you cant copy the the rest of the UI over
that would have to be updated for a web app

Originally I copied the three classes from the original test application into mine as I never thought to simply copy the classes over like you suggested. :slight_smile:

I did the following:

  • After doing what you suggest, I get the same error when the class is attached to the container control.
  • I then tried attaching the class to the main webpage that the container control is on, and I have success!!!

Would you consider it a bug that it can not be attached to the container control? And if so, is it a bug in the original classes (no big deal…they are free and open to fix ourselves) or in the container control itself (I should open a ticket)?

BTW @Norman Palardy …thank you for your work on this parser!!!

I have no idea why it would give you such an error
A sample sent to me might help me understand what you’ve set up

Just sent you a sample application to your Great White Software email address. It is working great now that I’ve attached it to the webpage…so I’m happy. :slight_smile: