on 02-14-2012 11:55 PM
Hi Experts,
I have build a MS Access Form and a Button after_click event. I like to add the SAP draft after the user click the Button.
I have create recordset but after I click the button, it said I havn't connect to company.
How to connect SAP company(which log on already) in MS access .
Thanks
Gary
Edited by: garywong0224 on Feb 15, 2012 10:55 AM
Hi Gary,
The basic steps to do what you are trying to do are as follows:
1. Add a reference to the DI API to your coding project. (apparently you got this done)
Then in your code:
2. Get the necessary data to perform business logic (apparently you got this done as well, with a record set)
3. Connect to the B1 system using an adaptation of the example code from your SDK installation. You should be able to find it somewhere around here: C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\01.BasicOperations\2003\*
4. Create a new document based on your business logic
5. Add the new document.
6. Dispose of the document object
7. If necessary repeat steps 4 - 6
8. Disconnect from B1 and dispose of all remaining B1 objects
9. Live happily ever after.
If you have the SDK installed, there will be examples for each step on your PC (C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\).
Just to make your own life a lot easier, I warmly suggest that you consider using VB.NET instead of MS Access's VBA. MS Visual Studio 2010 Express is free and can be downloaded from the internet. If you already know VBA it should only take you a week or two to learn.
Using VB.NET or C# has the added advantages that many many more people will be able to help you, and the internet is filled with tutorials and example code.
For printing purposes you can always connect MS ACCESS to your .NET application.
Good luck,
Johan
P.S. Just as a matter of interest, how did you manage to reference the DI API in MS Access ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Gary,
You say that you are logged on already. Could you please post the code you are using to connect to the company ?
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.