I actually do keep the connection open. I run the SP_LastInsertID statement right after the Insert:
sql = "insert blah blah blah" set objrs = objconn.execute(sql)
sql = "SP_LastInsertID") set objrs = objconn.execute(sql)
ListID = objrs(0)
This doesn't work. If I come back into the program (which optimizes the customer table when it starts, I can find the customer by phone number.)
I've tried optimizing using the sp_optimizeupdatesync Customer right after the insert statement but this doesn't work either.
I can see the customer in QuickBooks, but the VP Demo can't find it and my program can't find it unless I do a full optimize. With 16,000 + cusotmers and multiple inserts that need to be done at a time, this isn't working to well.
I also tried to skip the sp_LastInsertID and just search by phone number - same scenerio, I can not find the customer in either my program or the VB Demo until after I reoptimize the entire folder.
Any suggestions? Thanks for your help! I've written into this forum a couple times and I always appreciate your quick response. |