Solved

VB DLL In ASP??

Posted on 2003-11-14
7
341 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Window placement 17 65
Input past end of file vbs script 9 68
Sending a email via excel using vba 6 58
vb6 connector to mongodb 2 27
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
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…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now