Help with VB6 DLL and ASP Server Code


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 9 of 9

Thread: Help with VB6 DLL and ASP Server Code

  1. #1
    Join Date
    Aug 2005
    Posts
    12

    Help with VB6 DLL and ASP Server Code

    This is my client.dll
    Last edited by draven2kg; 08-30-2005 at 02:22 PM.

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    There are several problems. First, your CreateObject statement should use Set:

    Set ServerDLL = Server.CreateObject("SSvr.WebSvr")

    Second, all VBScript variables are Variants; you may need to change your server.dll to accept Variant parameters.

    Finally, the account under which your app is running (by default, the machine IUSR account) likely does not have permission to write to the root directory of C:. You might try creating the file in a folder to which the IUSR account has write permission.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Aug 2005
    Posts
    12
    #3 Fixing
    Last edited by draven2kg; 08-30-2005 at 02:22 PM.

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    I would try the code with the #1 and #3 fixes first. If it still doesn't work, try changing the parameters in server.dll to Variants.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Aug 2005
    Posts
    12
    Do i need to change all the parameters to variant in the ASP code and my client dll and server.dll? Make the string variants etc?

  6. #6
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    The variables in the ASP code are already Variants. I don't know if you need to make the parameters in the client and server DLLs Variants: try running the code without making them Variants, and if it doesn't work, try changing them to Variants.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  7. #7
    Join Date
    Aug 2005
    Posts
    12
    Can you take a look at my code to see if anything is wrong. I would much appreciate it. Here is it the way i have it



    In my Client.dll

    Public Function Lnk(dVal As Double, ByVal Ent As String, ByVal Cat As String, _
    ByVal Acc As String, ByVal Per As String, ByVal Fre As String, _
    ByVal App As String) As Variant




    myserverlink = m_sServerWithPrefix & WEB_PAGE & "?dV=" & dV _
    & "&En=" & Ent & "&Cat=" & Cat & "&Acc=" & Acc _
    & "&Per=" & Per & "&Fre=" & Fre & "&App=" & App

    I removed these for test. This does write to my c drive.


    ' Set fso = CreateObject("Scripting.FileSystemObject")
    ' Set txtfile = fso.CreateTextFile("C:\testfile.txt", True)
    '
    '
    ' txtfile.WriteLine (myserverlink)
    '
    ' txtfile.WriteLine ("Start Log : " & DateTime.Now)
    ' txtfile.WriteLine ("" & dV & " " & Ent & " " & Cat)
    '



    spider.Open "GET", myserverlink, False, "", ""
    spider.send

    End Function




    In my ASP, SumSvr.asp



    <%

    Dim ServerDLL
    Set ServerDLL = Server.CreateObject("SumSvr.WebSvr")

    Dim dV:dV=Request.QueryString("dV")
    Dim Ent:Ent=Request.QueryString("Ent")
    Dim Cat:Cat=Request.QueryString("Cat")
    Dim Acc:Acc=Request.QueryString("Acc")
    Dim Per:Per=Request.QueryString("Per")
    Dim Fre:Fre=Request.QueryString("Fre")
    Dim App:App=Request.QueryString("App")

    ServerDLL.Lnk dV,Ent,Cat,Acc,Per,Fre,App
    Set ServerDLL = nothing





    %>


    In my Server.dll



    Public Function Lnk(dV As Double, ByVal Ent As String, ByVal Cat As String, _
    ByVal Acc As String, ByVal Per As String, ByVal Fre As String, _
    ByVal App As String) As Variant



    Set fso = CreateObject("Scripting.FileSystemObject")
    Set txtfile = fso.CreateTextFile("C:\test\testfile.txt", True)



    txtfile.WriteLine ("Start Log : " & DateTime.Now)
    txtfile.WriteLine ("" & dV)




    End Function

  8. #8
    Join Date
    Aug 2005
    Posts
    12
    Anyone know anythig about this code, errors etc? cant seem to get it working right.

  9. #9
    Join Date
    Aug 2005
    Posts
    12
    Do i need to create some type of user so that i can log into the computer and write to a file?

Similar Threads

  1. Replies: 2
    Last Post: 03-01-2002, 05:06 PM
  2. DTC/MTS, ASP, Active X DLL - Newbie
    By David D. Cruger in forum Enterprise
    Replies: 0
    Last Post: 02-20-2002, 12:08 PM
  3. Replies: 0
    Last Post: 10-17-2001, 09:41 AM
  4. How To access server printers from ASP
    By Sudeep in forum ASP.NET
    Replies: 1
    Last Post: 09-27-2001, 09:29 AM
  5. Replies: 7
    Last Post: 09-15-2000, 09:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center