I have been asked to build a web application to report on information stored in another system. The other system is locked down but will allow me to export data as a csv file.
I’d like to use an html form on my application so that people (the night shift!) can import data from the other system to my web application.
To allow other people to understand my code I’ve been using vbscript and trying to use the following pattern in all database operations:
Open Connection
Build Query
Execute Query
Do something with results (if appropriate)
Close Connection
Is it possible to use this pattern to import a txt file? ie. purely sql based without using store procedures?
Does anyone have a code example?
Hope that makes sense.
Thanks.
Derek
Some notes.
You may have to enable ad hoc queries: http://technet.microsoft.com/en-us/library/ms187569.aspx
It is also possible to use the ACE provider for text, but it may get complicated: http://blogs.lessthandot.com/index.php/DataMgmt/DBProgramming/MSSQLServer/ace
Mixed data in columns can be a problem with CSV. IMEX can help, but only if the range checked, which is set in the registry, is suitable.
EDIT re comments
Some notes on viewing CSV data: