Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Execute query in xsl (vbscript)

From: "Ghena" <lastminutesud@-----.--->
To: NULL
Date: 4/6/2007 2:58:00 AM

I'm trying to execute a query directly in xsl

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform"  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:js="JavaScript" xmlns:user="VBScript">
<msxsl:script language="VBScript" implements-prefix="user">
<![CDATA[
function test(p)
for i=0 to p
ok = "<a class='xxx' href='results.asp?pag="&i&"'>["&i&"]</a>"& ok
next

test= ok
end function

function testSQL()
Dim Conn
Set Conn= Server.CreateObject("ADODB.Connection")
Conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&
server.MapPath("/mdb-database/fare.mdb")
dim SQL
SQL= "INSERT INTO bestPrice (id_hotel) "
SQL = SQL&"VALUES('1') "
conn.execute (sql)
conn.close

testSQL = SQL
set conn=Nothing
end function

]]>
</msxsl:script>

inside the template I call the function in this way:
<xsl:value-of select="user:testSQL()" />

but the system return  an error:

Microsoft VBScript runtime error Object required: 'Server' line = 12,
col = 0 (line is offset from the start of the script block). Error
returned from property or method call.

some advices ?

Thanks a lot.



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent