Hi All,

I have developed a web site and I am trying to show some contents on
one of the Web Pages from a Excel file.


I have created a small script but I am getting the error as mentioned
below. Can somebody please help me on this ?


VB Script :
<HTML>
<HEAD></HEAD>
<BODY>
<SCRIPT LANGUAGE="VBScript">
<!--


'## Create Connection and Recordsets
Dim Conn, RS
Set Conn = CreateObject("ADODB.Connection")
Set RS = CreateObject("ADODB.Recordset")
'## The Excel File Name
XLFile = "http://littlemastersachin.com/Documents/Book1.xls"


'## The Data to extract
szSQL = "select * from Events"


'## Create and open the connection
Conn.ConnectionString = "DBQ=" & XLFile & ";DRIVER=Microsoft
Excel
Driver (*.xls);UID=admin;"
Conn.Open
'## set the cursor to be static.
rs.cursortype = 3 ' adStatic.


'## open the recordset
rs.open szSQL, conn


'## Disconnect recordset, eliminate connection
rs.activeconnection = nothing
Conn.Close
Set Conn=nothing


'## iterate through the recordset.
while not rs.eof
response.write RS("name") & " -- "
response.write RS("location") & " -- "
response.write RS("Coordinator") & " -- "
response.write RS("Date") & " -- "
response.write RS("Time") & "<BR>"
rs.movenext
wend


RS.close
Set RS=nothing


-->
</SCRIPT>
</BODY>
</HTML>


When I am opening this page I am getting following error


Line: 28
Char: 5
Error:
Safety settings on this computer prohibit accessing a data source on
another domain.
Code: 0
URL: http://littlemastersachin.com/temp.aspx

Re: Error while trying to access excel file using HTML Code by Rafael

Rafael
Wed Dec 12 22:12:42 PST 2007

Suyog,

have you tried trusting the site on IE first?
if you have the html page on the same server as your excel file, it would be
better to create the page using asp.




--
**********
Rafael T


"suyog_linux" <suyog.shah@gmail.com> wrote in message
news:cafc5113-415f-4a1b-80cb-b97046984817@e6g2000prf.googlegroups.com...
> Hi All,
>
> I have developed a web site and I am trying to show some contents on
> one of the Web Pages from a Excel file.
>
>
> I have created a small script but I am getting the error as mentioned
> below. Can somebody please help me on this ?
>
>
> VB Script :
> <HTML>
> <HEAD></HEAD>
> <BODY>
> <SCRIPT LANGUAGE="VBScript">
> <!--
>
>
> '## Create Connection and Recordsets
> Dim Conn, RS
> Set Conn = CreateObject("ADODB.Connection")
> Set RS = CreateObject("ADODB.Recordset")
> '## The Excel File Name
> XLFile = "http://littlemastersachin.com/Documents/Book1.xls"
>
>
> '## The Data to extract
> szSQL = "select * from Events"
>
>
> '## Create and open the connection
> Conn.ConnectionString = "DBQ=" & XLFile & ";DRIVER=Microsoft
> Excel
> Driver (*.xls);UID=admin;"
> Conn.Open
> '## set the cursor to be static.
> rs.cursortype = 3 ' adStatic.
>
>
> '## open the recordset
> rs.open szSQL, conn
>
>
> '## Disconnect recordset, eliminate connection
> rs.activeconnection = nothing
> Conn.Close
> Set Conn=nothing
>
>
> '## iterate through the recordset.
> while not rs.eof
> response.write RS("name") & " -- "
> response.write RS("location") & " -- "
> response.write RS("Coordinator") & " -- "
> response.write RS("Date") & " -- "
> response.write RS("Time") & "<BR>"
> rs.movenext
> wend
>
>
> RS.close
> Set RS=nothing
>
>
> -->
> </SCRIPT>
> </BODY>
> </HTML>
>
>
> When I am opening this page I am getting following error
>
>
> Line: 28
> Char: 5
> Error:
> Safety settings on this computer prohibit accessing a data source on
> another domain.
> Code: 0
> URL: http://littlemastersachin.com/temp.aspx
>
>