Current location - Education and Training Encyclopedia - Graduation thesis - I am writing a paper on ASP.NET. How to input a data in ASP.NET and import it into EXCEL through connection?
I am writing a paper on ASP.NET. How to input a data in ASP.NET and import it into EXCEL through connection?
The key is to establish a connection with Excel. Getting data input is your preliminary work. I'll give you the password to establish the connection.

Mark cn as adodb. relationship

Set cn = New adodb。 relationship

Mark xlFile as a string

Xlfile = rem Enter the file name here.

sConnectionString = " Provider = Microsoft。 Jet. OLEDB.4.0 data source = "& ampxlFile & amp"; Extended attribute = ""Excel 8.0HDR = Yes; ”";"

With cn

. ConnectionString = sConnectionString

. open

End with ...

Later, you write an insert into statement and let cn execute it.