Problem: DLL VB6 / ASP / Database / Windows 2003 
Author Message
 Problem: DLL VB6 / ASP / Database / Windows 2003

Hi everyone

Description with sample:
I build a simple DLL in VB6 (Windows 2003)

Say Proyect1, Class1...

Class1 code:
Public Function Sum(X, Y)
    Sum = X + Y
End Function
(I use only Variants due to I will call from ASP)

Next, I publish this ASP in any site of IIS, say site1
<%
test1.asp
    Dim o
    Set o = CreateObject("Project1.Class1")
    Response.Write "Sum :" & o.Sum(7, 8)
    Set o = Nothing
%>

I run:
http://localhost/site1/test1.asp
Works fine: IE shows 15

All is right to here

I add any function in class1 that query any dtabase, say
Public Function DataTest()
    Dim rs As Recordset

    Set rs = New Recordset
    rs.Open "select * from Table", Provider=, adOpenStatic
    DataTest = rs.Fields(0).Value
    rs.Close
End Function
I test this function in VB environment and works fine.

I follow
<%
test2.asp
    Dim o
    Set o = CreateObject("Project1.Class1")
    Response.Write "DataTest :" & o. DataTest
    Set o = Nothing
%>

I run:
http://localhost/site1/test2.asp
Does not works: IE shows error 500

Why?
The Wondows 2003's IIS locks database?
Suggestions

Notes.
The same sample works fine in Windows 2000

--
Juan Marcial
Software Engineer



Wed, 06 Jul 2011 00:25:01 GMT  
 Problem: DLL VB6 / ASP / Database / Windows 2003
Since the code run in ASP/IIS needs to access other resources (database
here) in your second case, the user account configured in IIS for the ASP
must have permission to access the said database (what DB is it?). Have you
looked into this?


Quote:
> Hi everyone

> Description with sample:
> I build a simple DLL in VB6 (Windows 2003)

> Say Proyect1, Class1...

> Class1 code:
> Public Function Sum(X, Y)
>    Sum = X + Y
> End Function
> (I use only Variants due to I will call from ASP)

> Next, I publish this ASP in any site of IIS, say site1
> <%
> test1.asp
>    Dim o
>    Set o = CreateObject("Project1.Class1")
>    Response.Write "Sum :" & o.Sum(7, 8)
>    Set o = Nothing
> %>

> I run:
> http://localhost/site1/test1.asp
> Works fine: IE shows 15

> All is right to here

> I add any function in class1 that query any dtabase, say
> Public Function DataTest()
>    Dim rs As Recordset

>    Set rs = New Recordset
>    rs.Open "select * from Table", Provider=, adOpenStatic
>    DataTest = rs.Fields(0).Value
>    rs.Close
> End Function
> I test this function in VB environment and works fine.

> I follow
> <%
> test2.asp
>    Dim o
>    Set o = CreateObject("Project1.Class1")
>    Response.Write "DataTest :" & o. DataTest
>    Set o = Nothing
> %>

> I run:
> http://localhost/site1/test2.asp
> Does not works: IE shows error 500

> Why?
> The Wondows 2003's IIS locks database?
> Suggestions

> Notes.
> The same sample works fine in Windows 2000

> --
> Juan Marcial
> Software Engineer



Wed, 06 Jul 2011 07:23:02 GMT  
 Problem: DLL VB6 / ASP / Database / Windows 2003

Quote:
> (I use only Variants due to I will call from ASP)

That's not required.

Quote:
> .All is right to here

> I add any function in class1 that query any dtabase, say
> Public Function DataTest()
>    Dim rs As Recordset

>    Set rs = New Recordset
>    rs.Open "select * from Table", "Provider=.", adOpenStatic

"Provider=..." above is not using char 34(The double quote character). In my
system they have ASCII codes 147 and 148(Unicode &H201C and &H201D). This
happens when you copy something from HTML email. Depending on the font, they
may look exactly like char 34, but they are not. Try using this Hex editor
to see if the actual char codes:

http://www.chmaas.handshake.de/delphi/freeware/xvi32/xvi32.htm

Quote:
>    DataTest = rs.Fields(0).Value
>    rs.Close
> End Function
> I test this function in VB environment and works fine.

> I follow.
> <%
> ' test2.asp
>    Dim o
>    Set o = CreateObject("Project1.Class1")
>    Response.Write "DataTest :" & o. DataTest
>    Set o = Nothing
> %>

> I run:
> http://localhost/site1/test2.asp
> Does not works: IE shows error 500

VBScript supports On Error just like VB6. If you use it, you can use
Response.Write to print the error number and description to see why it's
happening.


Wed, 06 Jul 2011 07:58:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB 6.0 DLL debugging from ASP in Windows 2003 Server

2. VB 6.0 DLL debugging from ASP/IIS 6.0 in Windows 2003 Server

3. Windows Mobile 2003 development in VB6

4. Problems in running Direct3D on Windows 2003 server

5. Crystal Reports and asp.net (2003) help...

6. VB.Net and Windows Server 2003 Newbie

7. Windows XP 64-bit Edition Version 2003

8. Visual Studio .Net 2003 Final Beta, simple socket code breaks between 2002 and 2003

9. Windows 2003 Server WSH

10. VBScript User Creation Issues Under Windows 2003

11. Windows 2003 & SrvAny.exe

12. Windows Server 2003

 

 
Powered by phpBB® Forum Software