i have a client who tries to execute the following code which displays data in an excel workbook within the browser. however, the result of executing this code is 'unable to initialize visual basic environment". i am unable to duplicate this problem locally on my box.
could this prob be related to: the browser, the OS, version of office? any help would be greatly appreciated!!!
<%
Sub Display()
On Error Resume Next
If Instr(1,sSQL,"vRep"
Then
sSQL = replace(sSQL,"vRep","%'"
End If
set rs=server.CreateObject("ADODB.Recordset"
rs.Open sSQL,CON,3,2
Response.ContentType="application/vnd.ms-excel"
%>
<table border="1" align="center" width="700" cellpadding="0" cellspacing="0">
<tr>
<%
For each fld in rs.Fields%>
<td NOWRAP><%=fld.Name%></td>
<%Next
Response.Write "</tr>"
Do While rs.EOF=false
Response.Write "<tr>"
For each fld in rs.Fields
Response.Write "<td>" & fld.Value & "</td>"
Next
Response.Write "</tr>"
rs.MoveNext
loop
Response.Write "</table>"
If err.number <> 0 Then
Response.Write err.description
End If
End Sub
could this prob be related to: the browser, the OS, version of office? any help would be greatly appreciated!!!
<%
Sub Display()
On Error Resume Next
If Instr(1,sSQL,"vRep"
sSQL = replace(sSQL,"vRep","%'"
End If
set rs=server.CreateObject("ADODB.Recordset"
rs.Open sSQL,CON,3,2
Response.ContentType="application/vnd.ms-excel"
%>
<table border="1" align="center" width="700" cellpadding="0" cellspacing="0">
<tr>
<%
For each fld in rs.Fields%>
<td NOWRAP><%=fld.Name%></td>
<%Next
Response.Write "</tr>"
Do While rs.EOF=false
Response.Write "<tr>"
For each fld in rs.Fields
Response.Write "<td>" & fld.Value & "</td>"
Next
Response.Write "</tr>"
rs.MoveNext
loop
Response.Write "</table>"
If err.number <> 0 Then
Response.Write err.description
End If
End Sub