Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inet and Forms (can we use one without the other?)

Status
Not open for further replies.

jlindahl

Programmer
Sep 23, 2003
46
US
Must I place the Inet control on a form, or can I programatically get it initiated?
 
Once you've made a refernce to the object just declare like any other object.

Dim MyInet As Inet
 
Ok, now when I try to use MyInet I get an error.
Code:
Private Sub Main()
    Dim Inet1 As Inet
    Inet1.AccessType = icUseDefault
    With Inet1
        .Execute , "PUT", "C:\test.txt"
        .Execute , "CLOSE"
    End With
    
    MsgBox ("Complete")
    
End Sub

my error is 'run-time error 91: object variable or With block variable not set'
 
Sorry about that wasn't thinking try this:

Dim Inet1 As Object
Private Sub Main()
Set Inet1 = CreateObject("InetCtls.Inet")
Inet1.AccessType = icUseDefault
With Inet1
.Execute , "PUT", "C:\test.txt"
.Execute , "CLOSE"
End With
MsgBox ("Complete")
End Sub
 
ok, now i've got it working two ways, 1.no form, just a single module and 2.a form that will unload itself when complete.

now my question is, which one is better to run from an executeable? This will be a scheduled task that will run nightly, sending a file to a server and then receiving another file. is there a difference between the way the two programs run as far as a posibility for errors?
 
Well I don't see a need for a form unless you want to display something such as the progress of the task or you need some sort of interface with the user.
 
Well...it's trickier to get events...(but if you are not using the single event that Inet exposes, this shouldn't be a problem)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top