Question

Import excel file into Coldfusion

Asked by: TobinLewis

I am currently running a Coldfusion 5.0 application with a SQL 2000 backend database.

I am interested in creating a tool that will import student records from excel file into my user login table.  Details below.

We have developed an career search application that we market to high schools.  We have developed tools that allow the school to set up counselor accounts and then set up student accounts beneath each counselor.  This allows the school to run reports for the entire schools or by individual counselor.  We have been receiving requests over the past year to provide some sort of import tool that would allow the school to import their student user list in an excel or some type of delimited list format.  This would help them to not have to enter all of the student accounts by hand.

Is this doable in ColdFusion 5.0, if so how?  Would it be accomplished better using another tool or application, if so what application?  Are there any ColdFusion applications that have been created that do this?

Thanks for you help!

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-05-24 at 11:22:23ID21000393
Tags

excel

,

coldfusion

,

import

,

file

Topics

ColdFusion Application Server

,

ColdFusion Studio

Participating Experts
4
Points
500
Comments
21

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Schooling
    I would like to know what I should be studying so that I can join the multimedia field? What programs I should be proficient at? If I'm interested in Web Design and Graphics what should I know? I already have a BA in Communications, What type of schooling do I need? Maste...
  2. The route to a Visual Basic Career...
    Everyone who gives me a provocative thought will get some points on this one. Easy points. Relax and vent a story or two. I'm at a turning point in my life right now, debating whether to go to college to be a teacher of music and theory (which I've done all my life) or g...
  3. Career in SAP? good or bad?
    Hi Experts, I am working as a web developer for past 3 years with knowledge in HTML,ASP,SQL etc but feel that this has very little scope now, someone guided me about SAP, but I am not very sure about having a career in this. I have 2 choices for my long term career i.e to...
  4. Career As An SEO
    I think that the field of SEO / Internet Marketing is not to stable enough so that a person can make a career . agree / disagree , why?
  5. Email Marketing
    What are some considerations to take when email marketing campaigns? What are good companies to buy leads from? Thanks.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: shooksmPosted on 2004-05-24 at 12:35:03ID: 11146020

Here are some suggestions:

You could install the Office Web Components on your web server.  Then use the Excel object to open up an uploaded excel document and read data from it. (www.cfcomet.com has more info on OWC and the Excel object)

You could setup an Excel DSN in the CF Administrator pointing to a specific file location.  A user would then upload their excel document and you would store it at that file location.  Then you could write cfqueries off that datasource.  The one thing you will have to do is ensure that two people aren't uploaded the file at the same time so you will have to implement some type of locking in your app.

You could upload the document to the web server then kick off a DTS job in SQL 2000 to read in the excel data.  You could even have the page FTP the file directly to the SQL server to make writing the DTS job easier.  Personally, I think this would be the best solution.

If you can get them to go for Tab or Comma delimited file types, you could do the import really easy from CF itself.  Or make use of Bulk Copy/Bulk Insert in SQL server.

Just some ideas.  Let me know if you want to expand on a particular one and I'll see how I can help.

 

by: Tacobell777Posted on 2004-05-24 at 15:10:43ID: 11147102

The only correct solution, i.e. FREE, Robust etc. is using DTS since you are using MS SQL.

DTS is written to do exactly that, it could import a big excel file in less than a second, where as coldfusion (which is not made to do these things) would take several minutes.

Its fairly simple to write a dts package, go into MS SQL -> right click Data Transformation Services -> New Package -> throw a Excel connection on there and follow the prompts -> throw a Microsoft OLE DB provider connection on there and follow the prompts -> then put a Transform Data Task on there (going from excel to SQL) double click this task and see if you can figure out what to do ;-) if you need any help let me know.

 

by: mrichmonPosted on 2004-05-25 at 09:27:39ID: 11153624

TacoBell is right - it sounds like you have no need to use CF to do this.  So you should just import directly into SQL via DTS

 

by: shooksmPosted on 2004-05-25 at 10:41:15ID: 11154338

Bah, "the only correct solution".  There will always be more than one way to skin a cat.  But, that is three suggestions now for DTS.  Although from his question, I think he wants to at least use CF to accept the files to process from the user.  So CF will be involved for uploading the file and possible pushing the file to SQL and kicking off the DTS job.

 

by: Tacobell777Posted on 2004-05-25 at 13:07:11ID: 11155645

Bah??

Shooksm, if you think there is anything that can handle this problem better than DTS please do say so, I always like to learn new things.

 

by: shooksmPosted on 2004-05-25 at 13:37:27ID: 11155872

Again, many ways to skin a cat.  Even with SQL server.  Besides DTS you can use the Bulk Copy Utility, Bulk Insert, Openrowset and openquery to pull in heterogenous data.  So to say that DTS is "the only correct solution" would be incorrect.  Better to give the person all the options so they can figure out which one works best for their situation.

One problem that comes to mind with DTS is the running of a DTS job after the file is supplied.  How would you run it so that a low level web user account can kick it off.  You can not directly run DTS jobs unless you start giving the account used by the Cold Fusion server some pretty high level access to SQL.  For instance, to kick off a DTS job you could use Job Scheduler to accomplish this but that requires high level of access to the sp_job series of system stored procedures.  You can use the DTSRUN command line utility but that requires opening up access to the xp_cmdshell system stored procedures.  Do you really want a web server to have the ability to run command line tools on your database server?  To some, that risk is not worth the conveinence of DTS if the web server ever become comprimised.  You could schedule the DTS to run every minute and check for new files but that requires a lot of customization in the DTS job.

Also, take into account the entire picture.  The question was originally presented with the option of making delimited files.  Bulk Insert of delimitted text is by far faster than DTS of Excel data.  This can also be run right from a stored procedure or SQL query using bulkinsert vs having to schedule a job or run a command line utility with DTS.

 

by: TobinLewisPosted on 2004-05-27 at 06:50:59ID: 11171523

Hey Everyone...Thanks for all of the replys.

It sounds like DTS is the way to go if I was the one that was going to manipulate the uploaded file and import it.  It may turn out that this is the way that the process is handled due to the technical knowledge of most of my users. To start though, I'd like to try to develop a simple (for the user) process to upload a file through Coldfusion, have Coldfusion load the information into a view so that the user can verify the information is loading up into the correct columns (First Name, Last Name, Username, Password, ClassID).  Once they are satisfied that the information is correct, they could click an add button and the information would be loaded into the user database table.  

Is DTS still a viable option in this scenario?  I am probably looking at anywhere from 1500 to 2000 records of 5 or 6 fields each being added to the database.

 

by: shooksmPosted on 2004-05-28 at 11:27:33ID: 11182953

DTS won't help you with showing the view.  And if you only have 1500-2000 records, the hassle of getting DTS to work with this will probably be outweighed by the ease of just looping through the data and inserting especially if this file is infrequently uploaded.

 

by: Tacobell777Posted on 2004-05-28 at 14:10:19ID: 11184254

hassle with DTS? Its a hassle to write an import script in cf.

 

by: shooksmPosted on 2004-05-29 at 09:54:57ID: 11187806

Taco, I have already discussed the difficulties associated with calling DTS packages.  Try providing the person who asked the question with examples and instruction on solving the problem instead of complaining about everything I write as that is the point of this forum.

 

by: Tacobell777Posted on 2004-05-29 at 13:59:04ID: 11188686

Sure I will provide samples as soon as I know that DTS is the way he wants to go, I'm not wasting my time with a long explanation while he might not go for this option, he might go for some of the options that are really not that great and still provided in this expert forum, why waste my time?

BTW. CFEXECUTE AND DTSRUN work fine together, no special permissions needed. there you go.

PS. I don't complain mate, I am just stating the facts.

G'day

 

by: MyrandorPosted on 2004-05-31 at 15:20:49ID: 11199022

You could always code something. Like create an ODBC connection to your excel file (make sure the file is not opened before) and do some query to it! If you need help on how to access the data in excel, let me know! :)

 

by: Tacobell777Posted on 2004-06-03 at 22:04:10ID: 11229771

hi TobinLewis any luck with this? Need more help?

 

by: TobinLewisPosted on 2004-06-04 at 12:37:29ID: 11235993

Sorry it took me so long to get back to this, a few other projects have reared their ugly heads. I appreciate all of your responses.

Since this is something that is only going to be used by a handful of users (lots are asking for it, but oinly a few will take advantage of it), I think I'd like to try doing this in Coldfusion if possible.  

I am envisoning a wizard type process that would flow as follows.  The school site administrator logs in and selects the class account that the users will be imported into(i.e. class of 2008).  Then the site administrator will upload the file, possibly excel format, but could be another format.  Coldfusion then processes the file and outputs the results in a view in the appropirate columns and allows the site administrator to review for correctness.  Once satisfied that the information is correct, the site administrator clicks on an import button and the information is imported into the appropriate SQL table.  

Can I do all of this in Coldfusion?  How do I get started?  Does anyone have any examples of having done this?

Again, thanks for all of the help and responses.

Tobin

 

by: Tacobell777Posted on 2004-07-07 at 13:19:44ID: 11496170

Again I feel lots of valid solutions are posted.

 

by: Tacobell777Posted on 2004-07-07 at 13:37:37ID: 11496328

Ahh, your messages have changed, I guess the message confused me a bit. So next time no need to respond?

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...