Solved

VB DLL In ASP??

Posted on 2003-11-14
7
342 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DO Loop not working 4 72
Help in WHSCRIPT 9 47
Restricting text box entry from \/:?<>"| 9 76
bit defender blocks good applications 2 81
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…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

911 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

23 Experts available now in Live!

Get 1:1 Help Now