Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fastest lookup method

Status
Not open for further replies.

osumatt

Programmer
Dec 7, 2006
5
US
I'm new to ACCPAC programming but I've been working off of examples I've found and I've been having success entering orders into ACCPAC through an external program (.NET) by using the ACCPAC .NET libraries.

The problem I am having deals with performance. I'm trying to verify the existence of an order. What is the fastest way to check if an order exists? Also, if I need to position to this order to modify information on it, what's the fastest way to do this? I think it's a combination of .Fetch, .Browse and .Order.

BTW, I've done a lookup through ACCPAC's UI and recorded a macro, but it didn't really clear things up for me.
 
.Order=1
.Browse "ORDNUMBER = " & sOrder, True
if .Fetch then ....


Jay Converse
IT Director
Systemlink, Inc.
 
Also, I would make sure that all view compositions are done and done properly.

zemp
 
Thanks guys, I took both of your suggestions and it works great.
 
True, if you're updating. But if not, it's extra overhead.

Plus, if you're just verifying existence and not updating, then open the data link like this:

Set mDBLinkCmpRW = OpenDBLink(DBLINK_COMPANY, DBLINK_FLG_READONLY)

and you can pick up more speed.




Jay Converse
IT Director
Systemlink, Inc.
 
An alternate method:

.Order=1
.Fields("ORDNUMBER").PutWithoutverification sOrder
if .Read then ....

OR

if .Exists then .... (might be quicker than .Read, I have not checked the speed)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top