I have found out the sollution for it..
ADOExcel.dsn file:
[ODBC]
DRIVER=Microsoft Excel Driver (*.xls)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
ReadOnly=0
PageTimeout=1
MaxScanRows=8
MaxBufferSize=2048
FIL=excel 8.0
DriverId=790
DefaultDir=P:\Webserver\bovenbouw
DBQ=ADOExcel.xls
And i am using this code for connecting to the dsn file.
Remember this one. Its usefull..Code:var objExcel = Server.CreateObject("ADODB.Connection"); try { objExcel.Open ("FILEDSN="+Server.MapPath("ADOExcel.dsn")); } catch ( e ) { ADOExcelException ( e ); } var objRecordSet = Server.CreateObject("ADODB.Recordset"); objRecordSet.Open ( "SELECT * FROM myRange1", objExcel ); Out ( objRecordSet.Fields.Item(0).Name + '<br>' ); Out ( objRecordSet.Fields.Item(1).Name + '<br>' ); Out ( objRecordSet.Fields.Item(2).Name + '<br>' ); while ( !objRecordSet.EOF ) { for (x=0; x<3; x++){ Out ( objRecordSet.Fields.Item(x).value + '<br>' ); } objRecordSet.MoveNext(); } objRecordSet.Close(); objExcel.Close(); objRecordSet = undefined; objExcel = undefined;![]()





Reply With Quote