Forum Moderators: open

Message Too Old, No Replies

ASP code for Closing Processes?

is there such a beast

         

txbakers

10:20 pm on Jun 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm running a routine that reads through an excel file and populates a database.

If there is an error in the excel file (too many chars, etc.) the routine crashes, and the system process stays open. I have go into the task manager and manually kill the process to end it, so the user can try again.

I need to know how to trap the errors using javascript and the following code:

CMD.ActiveConnection = SQLCONN;
CMD.CommandText = sqlDET;
CMD.Execute();

Would a try/catch work here? Can someone please post or mail the syntax for me?

Thanks!

TheNige

4:00 am on Jun 27, 2006 (gmt 0)

10+ Year Member



Do you have to explicitly open Excel? Can you use the OLEDB adapters to query the values from the spread sheet?

txbakers

2:11 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've never tried that one!

Do you have a sample code for that?

TheNige

9:33 pm on Jun 27, 2006 (gmt 0)

10+ Year Member



You shold be able to find something on the net by doing a search. But basically you just need to put the path to the Excel file in the connection string. You can use the Jet drivers and then do sql queries on the sheet.

As long as your file is pretty tabular in nature this will work good. If you need to access specific cells then it might be harder.

txbakers

10:36 pm on Jun 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Might be able to do ODBC also on it.

I do read by cell, then populate the SQL query.

I'll play.