Solved

VB DLL In ASP??

Posted on 2003-11-14
7
347 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 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
Industry Leaders: 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

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!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

688 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