Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

What's wrong with these VB codes

What's wrong with these VB codes

What's wrong with these VB codes


I'm trying to write a simple VB form with an AccpacDataSource, an AccpacFieldEditControl and an AccpacViewList. In design mode, everything is ok. I can set a ViewID to the AccpacDataSource (GL0001 for example) link the FieldEdit and ViewList to the datasource etc.

However, at run time, I can not Set the AccpacDataSource.Active to True.... It always report an error "Method Active of object IAccpacDataSource failed".
Before setting the Active Property, I have these codes:

Dim mySession as new AccpacCOMAPI.AccpacSession
dim mySignonManager as New AccpacSignonManager.AccpacSignonMgr

mySession.Init "", "CS", "CS0001", "5.0"
mySignonManager.Signon mySession
(adsGL0001 is the name of my AccpacDataSource control)

If you could please point out what might be wrong with the code and/or provide me with a source of a small VB program with those control and can open any view using sample company, I would very much appreciate it.

Thank you very much

RE: What's wrong with these VB codes


The only error i have counted in the above code is the application version does not match the activated data of company database.

You should init the session like this and then tell me

mySession.Init "", "CS", "CS0001", "50A"

It will solve your problem. Any other problem in ACCPAC customization if you are facing, you can contact me on ilyasanjum@hotmail.com. I will try to solve your problem.


RE: What's wrong with these VB codes

Thank you very much ilyasanjum.

Actually later after posting this, I found it out myself. Yeah, I was indeed wrong in the session.Init. There seemed to be no documents or examples about how the last parameter should be. Only until I disassembled one of Accpac file and found that it should be like "50A" instead of "5.0"

Thank you very much for your solution and your offer for future help. I've saved your email to my address book and will sure contact you should I have any problem with Accpac customization.

Wish you health and success

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close