Discussion:
How to instance axapta object from .net business connector in VBSc
(too old to reply)
Frank Wong
2007-12-18 13:10:02 UTC
Permalink
Hi,

I was able to instance Axapta com object in VBScript;

But now I try to use Dynamics AX .net business connector, I get problem
saying can not instance the object:

Code:
dim objAXA
set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")

Can anyone help me?

Thanks
Dilip
2007-12-20 05:25:28 UTC
Permalink
Post by Frank Wong
Hi,
I was able to instance Axapta com object in VBScript;
But now I try to use Dynamics AX .net business connector, I get problem
dim objAXA
set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Can anyone help me?
Thanks
Hi Frank,

Since this is a .Net assembly and it resides in GAC, you need to
register it inorder to use it from VBScript, Try registering the
assembly using regasm utility found in C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727. (-> path where .Net framework is installed).

Go to command line and type regasm <path of your Business Connector
dll>
This will create the necessary registry entries for your VBScript to
create the object and you can then go ahead and use this component in
your vb script.

I hope you might be aware that in the Dynamics AX 4.0 installation
setup, we do have an option to install Axapta COM Connector which we
used in 3.0, it's given as backward compatibility. You can use that
for creating instance objects from VBScript.

Hope that helps.

Thanks and Regards,
Dilip
http://daxdilip.blogspot.com
Frank Wong
2008-01-01 14:29:00 UTC
Permalink
Hi Dilip,

Thank you very much for your help.

Now I try to use Axapta COM Connector in VB Script for AX 4.0:
1. I install Axapta COM Connector
2. Regsvr32 axcom.dll

Then I try to create object from VBScript by:

set objAXA = CreateObject("AxaptaCOMConnector.Axapta")

Then I get error saying: ActiveX component can not create object
'AxaptaCOMConnector.Axapta'

And I check 'component service', there is no component there.

I was able to run VBScript to connect to AX 3.0. Are there steps I miss?

Your help is highly appreciated!

Frank
Post by Dilip
Post by Frank Wong
Hi,
I was able to instance Axapta com object in VBScript;
But now I try to use Dynamics AX .net business connector, I get problem
dim objAXA
set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Can anyone help me?
Thanks
Hi Frank,
Since this is a .Net assembly and it resides in GAC, you need to
register it inorder to use it from VBScript, Try registering the
assembly using regasm utility found in C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727. (-> path where .Net framework is installed).
Go to command line and type regasm <path of your Business Connector
dll>
This will create the necessary registry entries for your VBScript to
create the object and you can then go ahead and use this component in
your vb script.
I hope you might be aware that in the Dynamics AX 4.0 installation
setup, we do have an option to install Axapta COM Connector which we
used in 3.0, it's given as backward compatibility. You can use that
for creating instance objects from VBScript.
Hope that helps.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com
Dilip
2008-01-03 00:52:58 UTC
Permalink
Post by Frank Wong
Hi Dilip,
Thank you very much for your help.
1. I install Axapta COM Connector
2. Regsvr32 axcom.dll
set objAXA = CreateObject("AxaptaCOMConnector.Axapta")
Then I get error saying: ActiveX component can not create object
'AxaptaCOMConnector.Axapta'
And I check 'component service', there is no component there.
I was able to run VBScript to connect to AX 3.0. Are there steps I miss?
Your help is highly appreciated!
Frank
Post by Dilip
Hi,
 I was able to instance Axapta com object in VBScript;
 But now I try to use Dynamics AX .net business connector, I get problem
 dim objAXA
 set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
 Can anyone help me?
 Thanks
Hi Frank,
Since this is a .Net assembly and it resides in GAC, you need to
register it inorder to use it from VBScript, Try registering the
assembly using regasm utility found in C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727. (-> path where .Net framework is installed).
Go to command line and type regasm <path of your Business Connector
dll>
This will create the necessary registry entries for your VBScript to
create the object and you can then go ahead and use this component in
your vb script.
I hope you might be aware that in the Dynamics AX 4.0 installation
setup, we do have an option to install Axapta COM Connector which we
used in 3.0, it's given as backward compatibility. You can use that
for creating instance objects from VBScript.
Hope that helps.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com- Hide quoted text -
- Show quoted text -
Hi Frank,

Try this

set ax=CreateObject("AxaptaCOMConnector.Axapta3.1")

Hope it helps you and wish you a very happy new year.

Thanks and Regards,
Dilip
http://daxdilip.blogspot.com/
Frank Wong
2008-01-09 01:23:01 UTC
Permalink
Hi Dilip,

Thanks very much for your help.

I am building application for device in VBScript.

How can I create network cridential in VB Script?

Which will be similar to 'System.Net.NetworkCredential credential = new
System.Net.NetworkCredential(_login, _password, _domain);'
Now I try to use proxy user to login.

Best regards,

Fred
Post by Frank Wong
Hi Dilip,
Thank you very much for your help.
1. I install Axapta COM Connector
2. Regsvr32 axcom.dll
set objAXA = CreateObject("AxaptaCOMConnector.Axapta")
Then I get error saying: ActiveX component can not create object
'AxaptaCOMConnector.Axapta'
And I check 'component service', there is no component there.
I was able to run VBScript to connect to AX 3.0. Are there steps I miss?
Your help is highly appreciated!
Frank
Post by Dilip
Post by Frank Wong
Hi,
I was able to instance Axapta com object in VBScript;
But now I try to use Dynamics AX .net business connector, I get problem
dim objAXA
set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
Can anyone help me?
Thanks
Hi Frank,
Since this is a .Net assembly and it resides in GAC, you need to
register it inorder to use it from VBScript, Try registering the
assembly using regasm utility found in C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727. (-> path where .Net framework is installed).
Go to command line and type regasm <path of your Business Connector
dll>
This will create the necessary registry entries for your VBScript to
create the object and you can then go ahead and use this component in
your vb script.
I hope you might be aware that in the Dynamics AX 4.0 installation
setup, we do have an option to install Axapta COM Connector which we
used in 3.0, it's given as backward compatibility. You can use that
for creating instance objects from VBScript.
Hope that helps.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com- Hide quoted text -
- Show quoted text -
Hi Frank,
Try this
set ax=CreateObject("AxaptaCOMConnector.Axapta3.1")
Hope it helps you and wish you a very happy new year.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com/
Dilip
2008-01-10 17:35:39 UTC
Permalink
Post by Frank Wong
Hi Dilip,
  Thanks very much for your help.
  I am building application for device in VBScript.
  How can I create network cridential in VB Script?
  Which will be similar to 'System.Net.NetworkCredential credential = new
System.Net.NetworkCredential(_login, _password, _domain);'
  Now I try to use proxy user to login.
Best regards,
Fred
Post by Frank Wong
Hi Dilip,
Thank you very much for your help.
1. I install Axapta COM Connector
2. Regsvr32 axcom.dll
set objAXA = CreateObject("AxaptaCOMConnector.Axapta")
Then I get error saying: ActiveX component can not create object
'AxaptaCOMConnector.Axapta'
And I check 'component service', there is no component there.
I was able to run VBScript to connect to AX 3.0. Are there steps I miss?
Your help is highly appreciated!
Frank
Post by Dilip
Hi,
 I was able to instance Axapta com object in VBScript;
 But now I try to use Dynamics AX .net business connector, I get problem
 dim objAXA
 set objAXA = CreateObject("Microsoft.Dynamics.BusinessConnectorNet.Axapta")
 Can anyone help me?
 Thanks
Hi Frank,
Since this is a .Net assembly and it resides in GAC, you need to
register it inorder to use it from VBScript, Try registering the
assembly using regasm utility found in C:\WINDOWS\Microsoft.NET
\Framework\v2.0.50727. (-> path where .Net framework is installed).
Go to command line and type regasm <path of your Business Connector
dll>
This will create the necessary registry entries for your VBScript to
create the object and you can then go ahead and use this component in
your vb script.
I hope you might be aware that in the Dynamics AX 4.0 installation
setup, we do have an option to install Axapta COM Connector which we
used in 3.0, it's given as backward compatibility. You can use that
for creating instance objects from VBScript.
Hope that helps.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com-Hide quoted text -
- Show quoted text -
Hi Frank,
Try this
set ax=CreateObject("AxaptaCOMConnector.Axapta3.1")
Hope it helps you and wish you a very happy new year.
Thanks and Regards,
Dilip
http://daxdilip.blogspot.com/- Hide quoted text -
- Show quoted text -
Hi Frank,

You can use ax.LogonAs in vbscript provided that logged-on user is a
an account which is configured in ax. Regarding creating an object of
Network credential, I have never tried it. I will have to check it.

Thanks and Regards,
Dilip

Loading...