Excel
Hello I really appreciate your help but can you explain that what is ârecords.mdbâ in connstr? if we want to read an excel file than why mdb (Access) fine mentioned here, and where we shall put the excel sheet name? Iâll b thankful to you if you explain me that.
Code is given below
Bye
set dbExl = server.createobject("adodb.connection")
set rsExl = server.createobject("adodb.recordset")
connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=records.mdb ;Extended Properties=""Excel 8.0;HDR=Yes"""
dbExl.ConnectionString = connstr
dbExl.Open
sheetName = "Exl-sheet"
strQry = "select * from ["&sheetName&"$]"
rsExl.Open strQry, dbExl
do while not rsExl.eof
ID = rsExl(0)
FNAME = rsExl(1)
LNAME = rsExl(2)
rsExl.movenext
loop
Zaeem Sherazi
__________________
Zaeem Sherazi
|