Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VB DLL In ASP??

Posted on 2003-11-14
7
Medium Priority
?
349 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
[X]
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
  • 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 150 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

618 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