cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in using OCX in VB6 - error information "Bad variant type"

Former Member
0 Kudos

I'm running an interface developed in Visual Basic 6.0.

The source is:

Set LogonControl = CreateObject("SAP.LogonControl.1")

LogonControl.SystemNumber = Trim(data("SYSTEMNUM"))

LogonControl.Language = Trim(data("LANGUAGE")

LogonControl.Client = Trim(data("MANDANT")

LogonControl.ApplicationServer = Trim(data("APPSERVER"))

LogonControl.User = Trim(data("USER"))

LogonControl.Password = Trim(data("PASSWORD"))

Set SAPConn = LogonControl.NewConnection

SAPConn.Logon(0, True)

Set LsapFuncSAP = CreateObject("SAP.Functions")

Set LsapFuncSAP.Connection = SAPConn

Set LsapFuncRFC = LsapFuncionesSAP.Add "FUNCNAME"

LsapFuncRFC.Call

.......

I have SAP GUI 6.20 installed and the APP server is "R/3 Release 4.6C" with Oracle.

but in the line "Set LsapFuncSAP.Connection = SAPConn" generates one of this errors randomly:

"Bad variant type" or

"Internal application error"

When I make the connection to development SAP server, this interface works fine, but when I make the connection to the QA SAP server, doesn't work anymore.

I'm running this application from the same Windows 2000 Server allways...just change the SAP server I'm connecting to.

Thanks...

Miguel Aldatz

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi,Excuse me about bad variant type solved?

Former Member
0 Kudos

Resolved....

In the .trc files.... found "User XXXXXXX has no RFC authorization for function group RFC1.

change permisions and go live!!

Thanks...

Former Member
0 Kudos

hi,Excuse me about bad variant type solved?