Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

VB DLL In ASP??

Posted on 2003-11-14
7
345 Views
Last Modified: 2012-05-04
Hai all,
      I have creaed a dll in VB.
      Project Name : MyProj
      Class ModuleName : MyClass
 
      That Dll contains a function
      Public Function MyFunction(sName As String, tName As String) As Integer
On Error GoTo err1
    Dim data_Line As String
    Open (sName) For Input As #1
    Open (tName) For Output As #2
    Do Until EOF(1)
        Line Input #1, data_Line
        Write #2, data_Line
    Loop
    Close #1
    Close #2
    MyFunction = 1
    Exit Function
err1:
    MyFunction = 0
End Function


     Dll Name  : MyDll


      I registered MyDll.dll in Server using  regsvr32 command.

    I have created an ASP file In that file I used the following code...

Dim myObj
Set myObj = Server.CreateObject("MyProj.MyClass")
if myObj.MyFunction("c:\test.txt","d:\test_copy.txt")=1 then
      Response.write("Success")
else
      Response.write("Error")
end if
set myobj=nothing

this gets hanged....  in the browser

If I create another VB Exe Project and in that If I refer the dll and write the coding as

Dim myObj AS Object
Set myObj = CreateObject("MyProj.MyClass")
if myObj.MyFunction("c:\test.txt","d:\test_copy.txt")=1 then
      MsgBox "Success"
else
      MsgBox "Error"
end if
set myobj=nothing

and If I run this then I am getting the messagebox Success.

I am unable to trace the porblem. Can any one help me to solve this problem...

Thanks
Narayanaswamy
0
Comment
Question by:Narayanaswamy
  • 4
  • 2
7 Comments
 

Author Comment

by:Narayanaswamy
ID: 9746538
Do I need to set any Extra properties to the class or project

To work in ASP

Narayanaswamy
0
 
LVL 14

Accepted Solution

by:
Thandava Vallepalli earned 50 total points
ID: 9746734
Hello,

This is permission problem. Follow the procedure to overcome this problem.

In windows explorer select your source folder and destination folder (here they are C and  D drives).   And right click and select properties of those directories.  then select 'Security' tab.  Remove Everyone item from Name list box(If at all exists).   Press Add button   select  'IUSR_<Your Machine Name>' user.  give full control to the selected user.  Now run the asp program.


All the best,
V.Thandava Krishna.
0
 
LVL 14

Expert Comment

by:Thandava Vallepalli
ID: 9746762
Hello,

still don't understand follow this link....


http://www.aspemporium.com/aspEmporium/tutorials/permdenied.asp

All the best,
V.Thandava Krishna.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Narayanaswamy
ID: 9746764
Thanks  V.Thandava Krishna

I will now try that

Narayanaswamy
0
 

Author Comment

by:Narayanaswamy
ID: 9747052
Hallo  V.Thandava Krishna,

 It worked when I created a new Virtual Directory In  IIS

Narayanaswamy
0
 

Author Comment

by:Narayanaswamy
ID: 9747056
Hello  V.Thandava Krishna,

 It worked when I created a new Virtual Directory In  IIS

Narayanaswamy
0
 

Expert Comment

by:7of9121098
ID: 9748718
Your problem looks like its in IIS/ASP side because you are trying to output
a text file to the d: drive, IIS will not let you do that, security reasons. Try creating the output file to the c: drive. Lets see what happens....
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question