This example shows how to use the Connection object properties so that the Connection object can connect to R/3 without displaying any dialog:
Dim g_oConnection as Object
Private Sub SAPLogonControl1_Click()
Rem ***Save Connection object to your global variable
Set g_oConnection = SAPLogonControl.NewConnection
Rem ***Either all parameters are set by the design environment (except the password) or they are hardcoded, as in the following lines
Rem ***The following lines depend on your R/3 environment
Rem ***These are the system parameters
g_oConnection.System ="R30" 'Name of your R/3 System
g_oConnection.ApplicationServer = "hs2001" 'Applic.Server of R/3 System
g_oConnection.SystemNumber = 0 'SystemNumber of your R/3 System
rem ***User specific data
g_oConnection.User = "MyUserName"
g_oConnection.Password = "secret"
g_oConnection.Client = "000"
g_oConnection.Language = "E"
Rem ***Try to connect to the R/3 System
if g_oConnection.Logon (Form.hWnd, TRUE) = FALSE then
MsgBox "R/3 connection failed"
exit sub
end if
end sub
Rem ***Now the connection is established: you can call your functions