Ask a Question related to ASP Database, Design and Development.
-
Dave Karmens #1
Read CSV to SQL
Does anyone have an example of how to read a .csv file into a SQL
database with an ASP?
Dave Karmens Guest
-
Everyone Please Read This
Hi Everyone, I'm sending a letter to Adobe to request some improvements to the forums. I have given a bit of info in my 'Message for regulars'... -
read xml
hello how can i read only the value's of this xml into asp.net (vbs) ? I want the variables name and address Example: name = "Myname" <scorelist>... -
File system get auto change from read-write to read-oly
I have a very strange file system with OS Redhat 7.2 The file system is read-write, but some how it randomly changes to read-only at any time.... -
Read & Read/Write Groups
I am trying to achieve a solution to a (hopefully) simple scenario. I have a Solaris 9 server that is going to be used for sharing files. I... -
Bob Barrows #2
Re: Read CSV to SQL
Dave Karmens wrote:
You would be better off using DTS to do this (bcp if you have a 6.5 server).> Does anyone have an example of how to read a .csv file into a SQL
> database with an ASP?
Alternatively, with SQL 7 and above, there is a T-SQL command called "Bulk
Insert" which can be called from asp just as any other query would be
called. You should be able to find a lot of information about this command
in SQL Books Online (BOL).
I'm aware that a Google search will yield examples of using ADO or FSO to
open a text file and loop through its contents writing the data to a
database, but those solutions are not likely to perform as well as DTS or
Bulk Insert.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Bob Barrows Guest
-
Dave Karmens #3
Re: Read CSV to SQL
Aaaaah... ok, I'll take a look around. Thanks Bob!
Bob Barrows wrote:
> Dave Karmens wrote:
>>>>Does anyone have an example of how to read a .csv file into a SQL
>>database with an ASP?
>
> You would be better off using DTS to do this (bcp if you have a 6.5 server).
> Alternatively, with SQL 7 and above, there is a T-SQL command called "Bulk
> Insert" which can be called from asp just as any other query would be
> called. You should be able to find a lot of information about this command
> in SQL Books Online (BOL).
>
> I'm aware that a Google search will yield examples of using ADO or FSO to
> open a text file and loop through its contents writing the data to a
> database, but those solutions are not likely to perform as well as DTS or
> Bulk Insert.
>
> Bob Barrows
>
>
>Dave Karmens Guest
-
Bullschmidt #4
Re: Read CSV to SQL
You can connect to a csv file (which can be opened in Excel and which an
Excel file can be converted into) in good form just as you can to a
regular database.
The .csv file needs to be uploaded to the server.
And you can have two recordsets open at the same time.
So I'd suggest going through this recordset one row at a time and within
this loop add a new record to the "real" database's recordset.
And for help connecting to a text file using the Jet OLE DB provider:
[url]http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#O[/url]
LEDBProviderForMicrosoftJetText
And based on the above link realize that the actual filename does NOT go
in the connection string - rather it goes in the SQL statement
(definitely a little tricky).
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
[url]http://www.Bullschmidt.com[/url]
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Bullschmidt Guest



Reply With Quote

