Solved

How can i test com with vbscript or sqlserver?

Posted on 2002-07-22
11
279 Views
Last Modified: 2010-05-02
I have created a ActiveX COM Object. now how can i move it to different server without creating installation program.

I used wininet.dll api in COM but all IE coms with wininet.dll. I used wininet.dll to download data from website. Do i need to create an instllation program to run it from different machine.

It woks greate from my machine but how can i test it from different machine without installing it. can i test by just copying dll file in a second server and using vbscript or sql server.


In second server following code works on asp but it fails on sqlserver job. Why? In development machine following code works in ASP and Sql server.

Dim sURL    
Dim oWininet
Set oWininet = CreateObject("ObjWininet.Download")
sURL = "http://www.yahoo.com"
strusername = Username
strPassword = Password
Call oWininet.Save(sURL, strusername, strPassword, "e:\temp\yahoo.htm")
Set oWininet = Nothing

0
Comment
Question by:bcp5190
[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
  • 5
  • 5
11 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7169774
listening...
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7169902
It fails with which error?

If it is 429, then some DLLs are not properly registered (or are not there at all).

Also, I see that you have "e:\temp\yahoo.htm". Does this exists on your other server?
0
 

Author Comment

by:bcp5190
ID: 7169979
I have temp folder in e:\ drive in second server. And From sql server job above code does not fail but it downloads blank page but from asp page same code successfully downloads website.
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:bcp5190
ID: 7169991
Here is some api call i'm using in com object to downlaod data from website.

Private Declare Function HttpOpenRequest Lib "wininet.dll" Alias "HttpOpenRequestA" (ByVal hHttpSession As Long, ByVal sVerb As String, ByVal sObjectName As String, ByVal sVersion As String, ByVal sReferer As String, ByVal something As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long

Private Declare Function HttpSendRequest Lib "wininet.dll" Alias "HttpSendRequestA" (ByVal hHttpRequest As Long, ByVal sHeaders As String, ByVal lHeadersLength As Long, ByVal sOptional As String, ByVal lOptionalLength As Long) As Integer

Private Declare Function InternetReadFile Lib "wininet.dll" (ByVal hFile As Long, ByVal sBuffer As String, ByVal lNumBytesToRead As Long, lNumberOfBytesRead As Long) As Integer


Private Declare Function InternetSetOption Lib "wininet.dll" Alias "InternetSetOptionA" (ByVal hInternet As Long, ByVal lOption As Long, ByRef sBuffer As Any, ByVal lBufferLength As Long) As Integer

......
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7170287
Just a guess, Save method is synchronius? Maybe a time out is present in on server and not in other.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7170289
And a question:
Couldn't you use ftpgetfile instead?
0
 

Author Comment

by:bcp5190
ID: 7170345
I try
Dim sURL    
Dim oWininet
Set oWininet = CreateObject("ObjWininet.Download")
sURL = "http://www.yahoo.com"
strusername = Username
strPassword = Password
Call oWininet.Save(sURL, strusername, strPassword, "e:\temp\yahoo.htm")
Set oWininet = Nothing
code in Data transfer Services packafe and place abouve code in activex script and it works fine in both machine.

I'm only having a problem in Sql server Agent Jobs scripts.

If i create a job for local package the it fails. but if i run local package manually it works
0
 

Author Comment

by:bcp5190
ID: 7170348
Sorry i cannot use any other method for downloading.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 50 total points
ID: 7170380
Well, if not timeout problem, what i could say is: Check your sqlserver settings in dev machine comparing with the nachine that fails...
0
 

Author Comment

by:bcp5190
ID: 7171730
Is there any specific setting i should check. Because if i create a package for above code then it works fine. It only fain when i run from SQL job
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7171781
I don't know sorry. i never used SQL server.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

724 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