<SCRIPT language=VbScript>
top.OutputFrame.document.open()
function fncSql()
top.OutputFrame.document.open()
Set cn = CreateObject("ADODB.Connection")
strConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & document.all.item( "FILE" ).value & ";" & _
"Extended Properties=""Excel 8.0;"""
cn.Open strConnection
Set rs = CreateObject( "ADODB.Recordset" )
SqlQuery = document.all.item( "SQL" ).value
rs.Open SqlQuery, cn
top.OutputFrame.document.write( "<HTML><HEAD>" )
top.OutputFrame.document.write( "<META HTTP-EQUIV=""Content-Type"" CONTENT=""text/html; CHARSET=shift_jis"">" )
top.OutputFrame.document.write( "</HEAD><BODY>" & vbCrLf )
top.OutputFrame.document.write( "<table border=1 cellpadding=5>" )
Do while not rs.EOF
top.OutputFrame.document.write( "<tr>" & vbCrLf )
for i = 1 to rs.fields.count
top.OutputFrame.document.write( "<td>" )
top.OutputFrame.document.write( rs.Fields( i-1 ).Value )
top.OutputFrame.document.write( "</td>" )
Next
top.OutputFrame.document.write( "</tr>" & vbCrLf )
rs.MoveNext
Loop
top.OutputFrame.document.write( "</table>" & vbCrLf )
top.OutputFrame.document.write( "</BODY><HTML>" )
rs.Close
cn.Close
end function
</SCRIPT>