Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read data from Excel using ASP and load it in Database (SQL)

Status
Not open for further replies.

najjar

Programmer
Jun 5, 2002
11
US
Hello,
I have an Excel File and it contains 1368 different
E-Mails and If you did not help me with how to

1- Read the data from the excel file.
2- Insert these data into my database
which is SQL Server.

Please help me or I'll make you type it manually
insted of me
Thank You
 
najjar,

This should help you read in your Excel file.

Set objXL = WScript.CreateObject("EXCEL.application")
' objXL.Visible = True
objXL.WorkBooks.Open "C:\mydir\MyExcel.xls"
Set objWkBook = objXL.Workbooks.Item("MyExcel.xls")
Set Actv = objWkBook.Worksheets("sheet1")

rows = Actv.UsedRange.rows.Count
cols = Actv.UsedRange.columns.Count

For Irow = 1 to rows
For Icol = 1 to cols
xval = Trim(Actv.Cells(Irow,Icol).Value)
Next
Next ' Next row


fengshui_1998
 
I want to thank you
I didn't try it yet
but it looks good to me
thank you agian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top