-
Help with VB6 DLL and ASP Server Code
Last edited by draven2kg; 08-30-2005 at 01:22 PM.
-
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!
-
Last edited by draven2kg; 08-30-2005 at 01:22 PM.
-
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!
-
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?
-
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!
-
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
-
Anyone know anythig about this code, errors etc? cant seem to get it working right.
-
Do i need to create some type of user so that i can log into the computer and write to a file?
Similar Threads
-
By Satish in forum ASP.NET
Replies: 2
Last Post: 03-01-2002, 04:06 PM
-
By David D. Cruger in forum Enterprise
Replies: 0
Last Post: 02-20-2002, 11:08 AM
-
Replies: 0
Last Post: 10-17-2001, 08:41 AM
-
By Sudeep in forum ASP.NET
Replies: 1
Last Post: 09-27-2001, 08:29 AM
-
Replies: 7
Last Post: 09-15-2000, 08: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks