Home > Archive > ASP > April 2004 > ASP on IIS6 Error - cannot call sub/functions - very strange
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
ASP on IIS6 Error - cannot call sub/functions - very strange
|
|
| Daniel Schwab 2004-04-08, 7:30 am |
| Hi
I am trying to run an old-style ASP Page on an IIS6 and got stuck!
Struggling for hours now. :-(
My Problem is:
- I can write a function/sub which does return strings/ints...
- I _cannot!_ write a function/sub which does open a ADODB.Database
Connection and returns it.
- The ADODB.Connection works only if i use them directly within the
function, not outside. Seems
like the function is giving some strange stuff back. When i try to use the
"Connection" it spells
out: <<Object required: 'Provider=MSDASQL.1;E' >>
What I've done so far:
- Parents Paths stuff :
http://www.ilopia.com/Windows+Serve...FAQ/IIS/87.aspx
- Checked that WebService Extensions ASP are set to "Allowed"
- Searched google for hours
- Rewrote my code 10 times. :-(
Please see demo programm and output below. Same Code is running on a IIS5
without problems.
ODBC-Entry is ok.
any hints, what did i miss?? I really don't know where to search next.
thnx
daniel
Example-Code:
----------------------------------
<%
function testme()
testme = "i am from testme"
end function
function dbopen()
set x = server.createobject("adodb.connection")
DSN = " DSN=MyDSNName;UID=MyUserName;PWD=SomeVer
ySecretPW"
x.Open DSN
'dummy-test, WORKS!
response.write "in func, DB open, read data, this will work too<br>"
set rs = x.execute("select * from tarif_abo")
while not rs.eof
response.write rs("DF_sAboChartLabelDe") & "<br>"
rs.movenext
wend
set dbopen = x
end function
response.write testme() & " / this will work <br><br>"
xy = dbopen ()
response.write "<br><br>here i don't get an DB Connection<br>"
set rs = xy.execute("select * from tarif_abo")
while not rs.eof
response.write rs("DF_sAboChartLabelDe") & " // outside<br>"
rs.movenext
wend
%>
------------------
output from Code
----------
i am from testme / this will work
in func, DB open, read data, this will work too
value1
value2
value3
value4
here i don't get an DB Connection
Microsoft VBScript runtime error '800a01a8'
Object required: 'Provider=MSDASQL.1;E'
/prv_asp/tb_include.asp, line 29
--------------------------
| |
| McKirahan 2004-04-09, 4:31 pm |
| "Daniel Schwab" <daniel.schwab1@swisscom.com> wrote in message
news:1081419019.62265@ftpgate...
> Hi
> I am trying to run an old-style ASP Page on an IIS6 and got stuck!
> Struggling for hours now. :-(
>
> My Problem is:
> - I can write a function/sub which does return strings/ints...
> - I _cannot!_ write a function/sub which does open a ADODB.Database
> Connection and returns it.
> - The ADODB.Connection works only if i use them directly within the
> function, not outside. Seems
> like the function is giving some strange stuff back. When i try to use the
> "Connection" it spells
> out: <<Object required: 'Provider=MSDASQL.1;E' >>
>
> What I've done so far:
> - Parents Paths stuff :
> http://www.ilopia.com/Windows+Serve...FAQ/IIS/87.aspx
> - Checked that WebService Extensions ASP are set to "Allowed"
> - Searched google for hours
> - Rewrote my code 10 times. :-(
>
> Please see demo programm and output below. Same Code is running on a IIS5
> without problems.
> ODBC-Entry is ok.
>
> any hints, what did i miss?? I really don't know where to search next.
>
> thnx
> daniel
>
> Example-Code:
> ----------------------------------
> <%
>
> function testme()
> testme = "i am from testme"
> end function
>
> function dbopen()
> set x = server.createobject("adodb.connection")
> DSN = " DSN=MyDSNName;UID=MyUserName;PWD=SomeVer
ySecretPW"
> x.Open DSN
>
> 'dummy-test, WORKS!
> response.write "in func, DB open, read data, this will work too<br>"
> set rs = x.execute("select * from tarif_abo")
> while not rs.eof
> response.write rs("DF_sAboChartLabelDe") & "<br>"
> rs.movenext
> wend
>
> set dbopen = x
>
> end function
>
> response.write testme() & " / this will work <br><br>"
>
> xy = dbopen ()
>
> response.write "<br><br>here i don't get an DB Connection<br>"
> set rs = xy.execute("select * from tarif_abo")
> while not rs.eof
> response.write rs("DF_sAboChartLabelDe") & " // outside<br>"
> rs.movenext
> wend
>
> %>
> ------------------
>
> output from Code
> ----------
> i am from testme / this will work
>
> in func, DB open, read data, this will work too
> value1
> value2
> value3
> value4
>
>
> here i don't get an DB Connection
>
> Microsoft VBScript runtime error '800a01a8'
>
> Object required: 'Provider=MSDASQL.1;E'
>
> /prv_asp/tb_include.asp, line 29
>
> --------------------------
Use "Option Explicit" and declare "x" and "rs" as a global variables.
I'd also suggest calling them "objADO" and "objRST".
|
|
|
|
|