Import datafile into SQL Server via ASP

Results 1 to 2 of 2

Thread: Import datafile into SQL Server via ASP

  1. #1
    Paul Winfield Guest

    Default Import datafile into SQL Server via ASP

    Hi All<BR><BR>I hope someone can through some ideas my way - what I need to do is enable someone to import user details held in an excel spreadsheet into a SQL Server db. <BR><BR>The reason is that a client requiring use of the site may have a large number of employees who need to be allowed site access. They will supply an excel file (or maybe just plain CSV) in the format: USERNAME,PASSWORD,ACCOUNTID. This file is then emailed to someone who administers user access to the site via a site based interface; this file can then be uploaded to the site via a file upload box. What I then need to do is pick up this file and import the data into the users table of my database. Is there an easy way to do this sort of thing or do I have to do it all manually?<BR><BR>TIA, Paul

  2. #2 Guest

    Default RE: Import datafile into SQL Server via ASP

    You just use CSV file. Use FileSystemOject to open the file and read it a line at a time. Use the Split function separate the values into an array and insert the values into a database record.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts