Home > front end >  An import excel genuflect is begged to sql2000 asp source code?
An import excel genuflect is begged to sql2000 asp source code?

Time:10-04

Haven't contact to programming for a long time, now need to work, do a simple asp website, for the convenience of using the people not to import the data server & amp; Database account password category, you need to do an excel imported into the sql2000 function,
Because didn't contact with for a long time, the basic and forgotten, a pile of search on the net out cannot achieve,
Problems which have ready-made can be used, can contribute the thank you very much

The table name: usertable
Fields: name (name), idno (id), tel01 (telephone), tel02 (telephone), drtime (import time, automatically collect now value), datatype (customer type)

CodePudding user response:

nobody reason, oneself the top

CodePudding user response:

SQLserver2000 bring import Excel function (as long as the corresponding field can), if stubbornly ASP after read write to also go, but it's trouble,

CodePudding user response:

Fileall=""
The Set cn=Server. CreateObject (" ADODB. Connection ")
Cn. The Provider="Microsoft. Jet. The OLEDB. 4.0"
Cn. The ConnectionString="Data Source=" & amp; Filepath& "; "& amp;" Extended Properties=8.0 Excel;"
Cn. Open
'SQL="select * from [sheet1 $]"
SQL="select * from [$A1: R65536]"
Rs. The open SQL, cn, 1, 1
Eof
the Do While Not rs.If the rs (rs) Fields (z). The name) & lt;>" "Then
For z=0 to rs. Fields. The count - 1
Fileall=fileall& Rs (rs) Fields (z). The name) & amp; CRH (9)
Next
Fileall=fileall& CRH (10)
Rs. Movenext
The else
The exit do
End the if
Loop
Rs. Close
Cn. Close
The set cn=nothing

CodePudding user response:

1, upload the EXCEL file
2, read the EXCEL file a table to a DataSet
3, read the DataSet, line by line insert essentially a database

CodePudding user response:

Well, NPOI read EXCEL insert data table is good

CodePudding user response:

Asp three small cases about operation excel
http://bbs.ttasp.com/forum.php? mod=viewthread& Tid=122 & amp; Fromuid=3
(source: everyday ASP home)
  •  Tags:  
  • ASP
  • Related