<%
'constante ADO pentru buna functionare a RecordSetului
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockPessimistic = 2
set rs=server.CreateObject("ADODB.Recordset"
cale=server.mappath("./"
Set EConnection = Server.CreateObject( "ADODB.Connection" )
EConnection.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ="&cale+"\template.xls"&";ReadOnly=0;UID=admin;"
sub ExecuteExcelSQL(byval cmd)
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = cmd
rs.ActiveConnection = Connection 'The record set needs to know what connection to use.
rs.Open
end sub
Try to use ExcelDriver & ADO
This is my ExcelConection.asp
<%
'constante ADO pentru buna functionare a RecordSetului
Const adOpenStatic = 3
Const adUseClient = 3
Const adLockPessimistic = 2
set rs=server.CreateObject("ADODB.Recordset"
cale=server.mappath("./"
Set EConnection = Server.CreateObject( "ADODB.Connection" )
EConnection.Open "Driver={Microsoft Excel Driver (*.xls)};DBQ="&cale+"\template.xls"&";ReadOnly=0;UID=admin;"
sub ExecuteExcelSQL(byval cmd)
rs.CursorType = adOpenStatic
rs.CursorLocation = adUseClient
rs.LockType = adLockPessimistic
rs.Source = cmd
rs.ActiveConnection = Connection 'The record set needs to know what connection to use.
rs.Open
end sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.