Advertisement

10.02.2008 at 03:30PM PDT, ID: 23783473 | Points: 500
[x]
Attachment Details

Upload a csv file, import, and process int ASP and SQL 2005

Asked by Mach03 in Active Server Pages (ASP), MS SQL Server

I have a custom application that is written in Classic ASP with a SQL 2005 database, so I can't convert it to ASP.net at this time.


What is the proper method to upload a file, import it into SQL, then process the upload?

I have a few processes in place an each one seems to have some erratic errors.  The process that I've been using is

To upload biographical list of people:
 
1) Use ASPUpload to upload the file to the webserver

2) User CreateObject("Scripting.FileSystemObject") to open the file and examine it line by line.  Each line is checked for varchar in place of int, if           success, insert the line into the table tblTEMPBiographical, if error store the line # in a variable.

3) Reported success and error numbers, alone with the error line# and reason why it was invalid

4) Use Set rs = dc.Execute(dSQL) where dSQL = "spAdminBiographicalProcess".  This SP selects all the IDs and Names and inserts it to tblTempName, then selects all the IDs and Addresses and inserts them into tblTempAddress

5) Use Set rs = dc.Execute(dSQL) where dSQL = "spAdminBiographicalTransfer".   This SP deletes the live tblName and inserts all data from tblTempNames to tblName, then it does the same process for Address:  tblTempAddess to tblAddress

I seem to be having issues around step 4 where it will timeout on me and move to step 5 because both SP's are called in ASP (shown below).  
I know this example is rather simple, but is it the correct way do to this?  Am I completely off track here?

      ConnectDatabase dc
      ConnectRecordset rs      
      dSQL = "spAdminBiographicalProcess"
      Set rs = dc.Execute(dSQL)
      dSQL = "spAdminBiographicalTransfer"
      Set rs = dc.Execute(dSQL)
      Set rs = Nothing
      Set dc = Nothing

Please help!

Thank youStart Free Trial
[+][-]10.03.2008 at 07:37AM PDT, ID: 22634404

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10.06.2008 at 12:19PM PDT, ID: 22653396

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.04.2008 at 08:35PM PST, ID: 22883163

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.05.2008 at 05:52AM PST, ID: 22885517

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.05.2008 at 07:17AM PST, ID: 22886290

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]11.05.2008 at 09:46AM PST, ID: 22887857

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 - Hierarchy / EE_QW_2_20070628