r_nagu
29th May 2002, 19:22
Hi,
I am trying to connect to baan from Excel and extract some data back to Excel. There is lot of information already on this forum regarding this and it is very useful. Based on the information I read, I wrote this piece of code in excel (VB) and when I executed it, for some reason it is not able to create the object Baan4.Application. The program keeps going to CannotCreateBaan: routine and give me the error message Unable to start BaaN.
Here is the script:
Dim BaanObj As Object
Private Sub CommandButton1_Click()
Call open_baan
End Sub
Sub open_baan()
On Error GoTo CannotCreateBaan
Set BaanObj = CreateObject("Baan4.Application")
BaanObj.Timeout = 3600
On Error GoTo BaanAutomationError
Exit Sub
CannotCreateBaan:
Cells(2, 3) = "Unable to start BaaN"
Exit Sub
BaanAutomationError:
MsgBox "Baan IV automation error: " & BaanObj.Error
MsgBox "Return value function: " & B_function & " " & BaanObj.returnvalue
BaanObj.Quit
Set BaanObj = Nothing
Exit Sub
End Sub
We are using BaaN IV on Unix with BW client. Does the above mentioned script only works if you are running baan on windows?
Any feedback is greatly appreciated.
Thanks,
NS
mark_h
29th May 2002, 19:37
Are you trying this on a Windows Client? It sounds like it, but I am not sure. Run regedit and look for HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597}\LocalServer32 = C:\BAAN\bin\bw.exe /Automation. This is a copy from a line of the bw.reg file on my PC, your client should have a copy of it in the baan directory. If the entry is not found then you will need to run the bw.reg file on your PC to create the entries. I had the same problem when I first tried using OLE.
Mark
r_nagu
29th May 2002, 19:49
Mark,
I checked the registry and there was no entry as you have mentioned. So, I ran the bw.reg file on my PC and it made an entry in the registry. When I re-ran my code after this, I got the same error message (Unable to start Baan) along with a BW error message.
Here is the BW error message:
"1: Error in CreateInstance(IUnkown*, REFID, LPVOID*). SendOleEvent timed out."
Any ideas.
Thanks for your help.
NS
gfasbender
29th May 2002, 20:33
NS, you're running Baan IV not Baan 5 correct? Baan 5 uses object "Baan.Application" not "Baan4.Application".
You might want to also insure that you have the most current objects in Baan solution 13742.
r_nagu
29th May 2002, 21:43
Hi,
I was able to connect to Baan throug Excel but as soon as the program executes this "BaanObj.ParseExecFunction", I get an error message saying "Connection with server lost" and the application locks up.
Any suggestions?
Thanks,
NS
mark_h
29th May 2002, 22:27
Did you download the Baan solution Gordon mentioned? It seems to me this fixed this problem before for another user on the board. You might also want to post the code that will help us see if everything looks okay.
Good Luck!
Mark
r_nagu
29th May 2002, 22:49
Mark/Gordon,
I am trying to download the patch rightnow but I am not sure how far I get with this since we don't have the BaaN support.
Here is the complete scirpt.
Dim BaanObj As Object
Dim B_function As String
Dim Query As String
Sub GetBaanUsers()
If BaanObj Is Nothing Then
ConnectBaan
If BaanObj Is Nothing Then
End
End If
End If
ThisWorkbook.Sheets("Sheet1").Activate
Query = "select ttaad200.user from ttaad200 where ttaad200._compnr = 000"
B_function = "olesql_parse(" & Query & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
query_id = Val(BaanObj.returnvalue)
End Sub
Sub ConnectBaan()
Set BaanObj = CreateObject("Baan4.Application")
BaanObj.Timeout = 2000000
On Error GoTo CannotCreateBaan
Exit Sub
CannotCreateBaan:
Cells(2, 3) = "Can not connect to Baan"
End
End Sub
Sub DisconnectBaan()
If Not BaanObj Is Nothing Then
BaanObj.Quit
Set BaanObj = Nothing
End If
End Sub
I also checked the log messages in baan (log.bshell) and it reports "Attribute of unkown type 355"
Appreciate all your help.
Thanks,
NS
alejandro
30th May 2002, 00:30
When you run Excel have you a connection yet to BaaN?
If so, try to execute in BaaN this Object ottstpoledaemon. Then run your Excel code. To run it simply type ottstpoledaemon from menu option run program.
Also, which BW version are you using?
Al Smith
30th May 2002, 17:31
Hi,
You do have an error in your B_function string. The olesql_parse needs quotes ,chr(34), around the Query variable.
B_function = "olesql_parse(" & Chr(34) & Query & Chr(34) & ")"
Al.
r_nagu
31st May 2002, 15:56
Alejandro,
I tried your suggestion to run ottstpoledaemon and then try to run my code but, it would not work. We are using BW version B40c.61.
Al,
I did try your suggestion but got the same error message ("Connection with server lost").
What else could go wrong?
Thanks,
NS
Al Smith
31st May 2002, 16:36
Hi,
Do you know at what step the server connection is lost?
If not, try stepping through the code using F8.
After the Set BaanObj = CreateObject("Baan4.Application") is executed you should see the Option Dialog box at the bottom of your screen. Go into the shell and do a "PS". you should see the ttstpoledaem. Doing an "oic" should show the ottstpoledaemon object as loaded.
Continue to step through the code. After BaanObj.ParseExecFunction "ottdllsql_query", B_function is executed, again go into the Option Dialog shell and do a "oic". Now the ottdllsql_query object should be loaded.
Al.
r_nagu
31st May 2002, 20:15
Al,
The connection with server is lost the movment it executes BaanObj.ParseExecFunction "ottdllsql_query", B_function
After connecting to baan i ran the "oic" commnad and it does shows ottstpoledaemon object as loaded.
I could not check for ottdllsql_query object since it breks out just after BaanObj.ParseExecFunction "ottdllsql_query", B_function.
You think I might have the old BaanObj objects? where are located?
Thanks for your help.
NS
r_nagu
31st May 2002, 20:57
Well, this time it did not disconnect from baan but gave me this error message in log.bshell.
2002-05-31[13:21:30]:E:bsp: ******* S T A R T of Error message *******
2002-05-31[13:21:30]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/mir/mir/main.c: #879 keyword: stop
2002-05-31[13:21:30]:E:bsp: Pid 1576 Uid 125 Euid 125 Gid 125 Egid 125
2002-05-31[13:21:30]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-05-31[13:21:30]:E:bsp: Errno 0 bdb_errno 213 (Transaction is started but not updated)
2002-05-31[13:21:30]:E:bsp: Log_mesg: bshell received SIGTERM
2002-05-31[13:21:30]:E:bsp: ******* E N D of Error message ******
Hope I am getting closer.
Thanks,
NS
alejandro
31st May 2002, 22:40
Looking your previous post, and this last with log.bshell it seems that you are not completing your query. You have created a query_id, but you do not do anything later. This is true only if you posted complete code.
What I think you have to put before EndSub line in Sub GetBaanUsers is:
query_id = Val(BaanObj.ReturnValue)
B_function = "olesql_fetch(" & query_id & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
temp_string = "ttaad200.user"
user = String(10, " ")
B_function2 = "olesql_getstring(" & Chr(34) & temp_string & Chr(34) & "," & Chr(34) & user & Chr(34) & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function2
temp_string = BaanObj.FunctionCall
user = Mid(temp_string, 35, 10)
user = Trim(user)
'Then here you have the first user. I finish here, test it please, later we will comment
B_function = "olesql_break(" & query_id & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
B_function = "olesql_close(" & query_id & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
BaanObj.Quit
Set BaanObj = Nothing
Also when querying tables try to use index. In this case ttaad200.user is the key field, but I have used this query object with complex select statements and is mandatory to write them well. So the string query should be changed to:
Query = "select ttaad200.user from ttaad200 where ttaad200._compnr = 000 order by ttaad200._index1"
Hope this helps.
r_nagu
31st May 2002, 22:54
Alejandro,
The reason I did not complete the code is beacuse I was getting disconnected from baan with error message "("Connection with server lost")" as soon as the step "BaanObj.ParseExecFunction "ottdllsql_query", B_function " is executed.
I did copied your code and added to my privouslly posted code but, i still get the same error message i.e., "("Connection with server lost")" .
Here is the complete code:
Dim BaanObj As Object
Dim B_function As String
Dim Query As String
Sub GetBaanUsers()
If BaanObj Is Nothing Then
ConnectBaan
MsgBox ("Connected..")
Else
MsgBox ("Already connected")
End If
If BaanObj Is Nothing Then
End
End If
ThisWorkbook.Sheets("Sheet1").Activate
Query = "select ttaad200.user from ttaad200 where ttaad200._compnr = 000 order by ttaad200._index1"
B_function = "olesql_parse(" & Query & ")"
B_function = "olesql_parse(" & Chr(34) & Query & Chr(34) & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
query_id = Val(BaanObj.returnvalue)
BaanObj.ParseExecFunction "ottdllsql_query", B_function
temp_string = "ttaad200.user"
user = String(10, " ")
B_function2 = "olesql_getstring(" & Chr(34) & temp_string & Chr(34) & "," & Chr(34) & user & Chr(34) & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function2
temp_string = BaanObj.FunctionCall
user = Mid(temp_string, 35, 10)
user = Trim(user)
'Then here you have the first user. I finish here, test it please, later we will comment
B_function = "olesql_break(" & query_id & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
B_function = "olesql_close(" & query_id & ")"
BaanObj.ParseExecFunction "ottdllsql_query", B_function
Call DisconnectBaan
End Sub
Sub ConnectBaan()
Set BaanObj = CreateObject("Baan4.Application")
BaanObj.Timeout = 2000000
On Error GoTo CannotCreateBaan
Exit Sub
CannotCreateBaan:
Cells(2, 3) = "Can not connect to Baan"
End
End Sub
Sub DisconnectBaan()
If Not BaanObj Is Nothing Then
BaanObj.Quit
Set BaanObj = Nothing
End If
End Sub
Thanks,
Nagesh
r_nagu
31st May 2002, 23:20
I ran bic_info6.1 -a ottdllsql_query and after displaying all the information at the end it show the following.
---------------------------OBJECT IDENTS--------------------------------
@(#)/f3/BaanIVc/bse/tools/ttB40_b/pttdll/pdllsql_query0, 97/08/26 [07:12], From bsp
@(#)-DREL6_1
@(#)bic_global 7.16:7/17/97 Copyright (c) Baan International b.v.
@(#)bic_object 7.7.1.1:11/21/96 Copyright (c) Baan International b.v.
@(#)bic_event 6.1.1.2:6/13/96 Copyright (c) Baan International b.v.
@(#)bic_shell, 08-1994/R1, Copyright (c) Baan International b.v.
@(#)bic_fork 1.1:3/1/95 Copyright (c) Baan International b.v.
@(#) Call 10018477, 96/01/29: Error ; not expected, using date.to.num()
@(#) Call 10020566, 96/04/26: Error if using parenthesis on from/to fld
@(#) Call 10228702, 97/03/10: Error if parenthesis on date fields
@(#) Call 10241698, 97/05/01: Error when using exists
@(#) Call 10242579, 97/05/01: Error when using exists
@(#) Call 11609, 97/07/16: Error when using between
@(#)bic_process, 05-1992/R1, Copyright (c) Baan International b.v.
@(#)Call 441214, 1995/06/28
Its interesting because, when VB executes BaanObj.ParseExecFunction "ottdllsql_query", B_function I get disconnected from Baan with an error message "Connection lost with server" and it creates core file on Unix. When tried to read that core file, it had the same error message as given by the bic_info command i.e., . Error when using between, Error when using exists etc.,
I am thinking maybe my ottdllsql_query object is gone bad. Then again I am not 100% sure on this.
Just wanted to see what you guys think.
Thanks again,
NS
Al Smith
1st June 2002, 00:03
Hi,
I ran bic_info6.1 against mine and got similar results. But the function works.
As you might know, the ParseExecFunction can be run against almost any Baan object.
Try adding this in place of your ottdllsql_query and step through the code again using F8.
BaanObj.ParseExecFunction "ottstpcalc", "<4>"
After this line is executed, doing a "oic" in the shell should show the calculator object (ottstpcalc) as being loaded. You wont see the calculator itself.
If this works, at least we know that your ParseExecFunction will work and you might have a corrupted ottdllsql_query object.
Al.
r_nagu
1st June 2002, 00:17
Al,
I just ran the code you mentioned but, it gave me the same error message. So, I guess there is something wrong with ParseExecFunction itself. Where are these functions located?
Does BW version matters? we are using BW version B40c.61 and the baan server is a Unix machine. Baan version is B40c0.
Thanks,
NS
Al Smith
1st June 2002, 02:05
Hi,
We're using BW B40c.050 but I don't think it makes a difference.
The ParseExecFunction is referenced in the bw.tlb (Type Library) under the Baan/Lib directory. It has to be in the path that's shown in the bw.reg file.
If you right-click the bw.reg you should be able to select Edit and pull it up in Notepad. Below is the bw.reg from this computer.
Note the path to bw.tlb under the heading ; The Baan4 Automation Information below.
Another thing you might try is to set a reference in your VB program to point to this. Select "Project" on the VB menu then references. You should see Baan4 Type Library as one of the selections. (Note: If you're using Excel's VBA the reference is under tools.)
Good luck,
Al
NREGEDIT
;ident: $RCSfile: bw.reg $ $Revision: /main/1 $
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The BW configuration file association
;
HKEY_CLASSES_ROOT\.bwc = BW_Configuration
HKEY_CLASSES_ROOT\BW_Configuration = BW configuration file
HKEY_CLASSES_ROOT\BW_Configuration\shell\open\command = "C:\BAAN\bin\bw.exe" "%1"
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The Baan4 Application Class for Automation
;
HKEY_CLASSES_ROOT\Baan4.Application = Baan4 Application
HKEY_CLASSES_ROOT\Baan4.Application\CLSID = {00000000-4000-11ce-AAA8-00608C50C597}
HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597} = Baan4 Application
HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597}\InprocHandler32 = ole32.dll
HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597}\LocalServer32 = C:\BAAN\bin\bw.exe /Automation
HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597}\ProgID = Baan4.Application
HKEY_CLASSES_ROOT\CLSID\{00000000-4000-11ce-AAA8-00608C50C597}\VersionIndependentProgID = Baan4.Application
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The Baan4 Automation Information
;
HKEY_CLASSES_ROOT\TypeLib\{00000001-4000-11ce-AAA8-00608C50C597}
HKEY_CLASSES_ROOT\TypeLib\{00000001-4000-11ce-AAA8-00608C50C597}\1.1 = Baan4 Type Library
HKEY_CLASSES_ROOT\TypeLib\{00000001-4000-11ce-AAA8-00608C50C597}\1.1\0\win32 = C:\BAAN\lib\bw.tlb
HKEY_CLASSES_ROOT\TypeLib\{00000001-4000-11ce-AAA8-00608C50C597}\1.1\9\win32 = C:\BAAN\lib\bw.tlb
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The Baan4 DispInterface
;
HKEY_CLASSES_ROOT\Interface\{00000002-4000-11ce-AAA8-00608C50C597} = IDispatchBaan4
HKEY_CLASSES_ROOT\Interface\{00000002-4000-11ce-AAA8-00608C50C597}\ProxyStubClsid = {00020420-0000-0000-C000-000000000046}
HKEY_CLASSES_ROOT\Interface\{00000002-4000-11ce-AAA8-00608C50C597}\NumMethods = 7
HKEY_CLASSES_ROOT\Interface\{00000002-4000-11ce-AAA8-00608C50C597}\BaseInterface = {00020400-0000-0000-C000-000000000046}
otepad.
r_nagu
3rd June 2002, 16:40
Al,
I checked the path for bw.tlb and it looks like it is in the right place both in bw.reg and regedit.
I also checked the reference to bw.tlb in the Excel VBA and it was not selected. I selected it, compiled the VB script and ran the program again but, unfortunately i am still getting the same error message.
I am not sure what else could go wrong.
Thanks for all your help.
NS
mark_h
3rd June 2002, 20:54
Were you able to download the new objects that Gordon mentioned? It may not be the client side, but the server tools objects. I copied your code to a test macro and it worked just fine, so I figure it is the tools objects on the server(just a guess).
Mark
r_nagu
3rd June 2002, 22:12
Mark,
Yes, I was able to download and patch object ottdllsql_query but, even after this I am still facing the same problem. Everything goes ok till the command BaanObj.ParseExecFunction "ottdllsql_query", B_function and as soon as it executes this, the connection with server is lost and a core is dumped in my home directory. When I look at the log message under $BSE/log/log.bshell this is what i see.
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/lib/ds_1/ds_mess.c: #672 keyword: DS_NOKEYWORD
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Attribute of unknown type 355
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
2002-06-03[15:00:36]:E:bsp:
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/lib/ds_1/ds_mess.c: #672 keyword: DS_NOKEYWORD
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Attribute of unknown type 355
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
2002-06-03[15:00:36]:E:bsp:
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/mir/mir/gfx_obj.c: #1463 keyword: DS_INTERR
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Internal error
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
2002-06-03[15:00:36]:E:bsp:
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/lib/ds_1/ds_mess.c: #672 keyword: DS_NOKEYWORD
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Attribute of unknown type 355
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
2002-06-03[15:00:36]:E:bsp:
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/lib/ds_1/ds_mess.c: #672 keyword: DS_NOKEYWORD
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Attribute of unknown type 355
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
2002-06-03[15:00:36]:E:bsp:
2002-06-03[15:00:36]:E:bsp: ******* S T A R T of Error message *******
2002-06-03[15:00:36]:E:bsp: Log message called from /port.6.1c.05.01/vobs/tt/mir/mir/gfx_obj.c: #1747 keyword: DS_INTERR
2002-06-03[15:00:36]:E:bsp: Pid 4649 Uid 125 Euid 125 Gid 125 Egid 125
2002-06-03[15:00:36]:E:bsp: user_type S language 2 user_name bsp tty ote locale ISO88591/NULL
2002-06-03[15:00:36]:E:bsp: Errno 0 bdb_errno 0
2002-06-03[15:00:36]:E:bsp: Log_mesg: Internal error
2002-06-03[15:00:36]:E:bsp: ******* E N D of Error message *******
Does the Baan version matters? We are using B40c0.
Thanks again,
NS
mark_h
3rd June 2002, 23:03
I think this should work for all versions of Baan 4. We are on 4c3 and our client version is B40c.044. I do know that with our latest tools patch somethings are not working - like ttstpcreatdll, but the OLE piece does still seem to function.
I am attaching the readme.txt file from the C:\baan\samples directory. Do you have the samples directory? The readme.txt file says it will not work in the BX and BA environments. I believe our BSP user is setup only for the BA environment, not sure - but I do know it is different than one of our "normal" users. Just a thought - maybe try it using one of Baans samples, using a normal user logon.
Other than that, I guess I would recommend calling Baan support at this point, but you mentioned you all are not carrying support. I am not sure what else to try.
Mark
Al Smith
4th June 2002, 00:22
Hi,
This is a shot-in-the-dark but:
I wonder if the type library is registered correctly.
Check your registry (regedit) under HKEY_CLASSES_ROOT. Scroll down to TypeLib. There should be a class ID 00000001-4000-11ce-AAA8-00608C50C597.
Expand the folders 0 and 9 then open win32. These should be set to c:\BAAN\lib\bw.tlb.
Al.
By the way, what os are you using on the PC? win95/98, 2K, etc.
r_nagu
4th June 2002, 00:41
Al,
I checked the regedit and the path looks to be fine.
Mark,
Our baan is running on Unix but, we use BW client for endures. So, i think we are using bw environments not bx or ba. When I do the licmon6.1 -w it shows bx/bw under TYPE column.
I checked couple more things. I looked at the windows event viewer after the error message and this is what it shows
===============
The description for Event ID ( 1000 ) in Source ( Baan ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event: Env bw068 (c:\program files\baan 061)
Prog BW file p_oleaut.cpp # 519
Keyword TsMSOleAutomationRec::Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS far*, VARIANT far*, EXCEPINFO far*, UINT far*)
Username bsp type S language 2
Process 0x2a4
Lasterror 6 (The handle is invalid.)
Errno 0
bdberrno 0
Message 1 : DispInvoke failed, error = -2147352562
==============
Also, I am getting this VBA error message [Please see the attached]
Looks like this is becoming a real pain. I really appreciate all your help.
Thanks,
NS
günther
11th June 2002, 16:54
I've been looking for some of the posts in this tread. Then I checked the e.g. C:\baan\samples\baan.xls file, and started to wonder why they didn't run any more. I remember to have at least checked them to work.
The problem was CreateObject("Baan4.Application"), which was no longer correct for *my* configuration. I had to change that line into CreateObject("Baan4.Application.hera") -- hera is our test machine; I found that setting after pressing the [Configure] button on the bw client and switching to Tab 3 "Automation". My Client is B40c.63.
Maybe you should also have a look at your configuration.
Günther;)
mark_h
12th June 2002, 18:06
Just thought I would let everyone know that I have just installed a new BW client. My OLE macro that worked on the old client no longer works with the new client. I get the same error as r_nagu. The minute I hit the BaanObj.ParseExecFunction. I am going to have our admin place a call with Baan.
I can fix it by running regedit and changing Baan4.application to point to the old bw.exe client file. In other words I change the registry entry from LocalServer32 = C:\Program Files\Baan\bin\bw.exe /Automation to LocalServer32 = C:\Baan\bin\bw.exe c:\baan\lib\user\b4a.bwc /Automation. The first is the location of the new client and the second is the old client.
Mark
r_nagu
12th June 2002, 18:10
Mark,
Would you please let me know what Baan support says?
Thanks,
NS
mark_h
12th June 2002, 22:34
I will let you know what we find out. I have sent a document to our app admin to log a case. While waiting I am trying other things to see if I can get it to work, but so far no luck.
Mark
Al Smith
12th June 2002, 23:03
Hi,
I don't know if this will help but:
I needed a baan login and bwc file that was used only for automation functions (ottstpapihand) with no login dialog.
What I did was to place the /Automation command in the command section of the bwc file.
e.g.
[ApplicationServer]
bse=/baan2/baanivc/bse
bshell=bshellx
command=/Automation
location=
connection=
[Remote]
hostname=ssprd
username=web2baan
password64=removed by ~Vamsi
protocol=EXEC
portnumber=512
domain=
password=
logindialog=NO
serveros=
[NLS]
locale=ISO
RightToLeft=False
[Font]
fontName80=Fixedsys
fontWidth80=0
fontHeight80=-12
fontWeight80=normal
fontItalic80=NO
fontName132=Fixedsys
fontWidth132=0
fontHeight132=-12
fontWeight132=normal
fontItalic132=NO
I then changed the LocalServer32 registry entry to c:\baan\bin\bw.exe /Web2Baan.bwc
Al.
Al Smith
13th June 2002, 00:11
~Vamsi,
Thanks for removing the password.
I had corrupted it however.
Al.
mark_h
13th June 2002, 00:43
Hi Al!
I tried the setup you suggested but that did not work either. The only thing that works in the LocalServer32 is the old bw.exe file. For the new clients it looks like it creates another registry entry where LocalServer32=C:\Baan\BIN\BW.EXE /Automation "c:\Baan\LIB\USER\ole.bwc". It does this for each of your .bwc files. I am hoping to get a quick response back from Baan.
I did not mention this but the client I installed earlier was B40c.065.
Mark
r_nagu
13th June 2002, 03:20
Hi,
I tried Als suggestion too but it did not work. Hope BaaN support got some kinda answer for this. By the way the BW version I am using is B40c.61.
Thanks,
NS
Al Smith
13th June 2002, 16:04
Hi,
I'm using B40c.050.
I wonder if this situation with the newer clients is in Baan's automation object or perhaps an incompatibility with microsoft's ole32.dll which is the OLE InProcess handler.
If your up to trying more things, you should be able to run Baan from the "Run" command in your start menu. This bypasses the ole32.dll.
If you enter, for example:
c:\baan\bin\bw.exe "c:\baan\lib\user\Test.bwc"
You should get the full Baan menu browser.
If you change it to:
c:\baan\bin\bw.exe /Automation "c:\baan\lib\user\Test.bwc"
You should only see the option dialog. You'll have to kill the ttstpoledeam process to quit.
Al.
mark_h
13th June 2002, 16:42
Hi Al,
This thread (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5476) dicusses some of the client changes. I think it mentions the new client config started in 61 or 62. It looks like you get new registry entries for each bwc configuration. Below is a snapshot of the configuration format - I kind of like it.
The new client also works as you suggest. If I run c:\baan\bin\bw.exe /Automation "c:\baan\lib\user\any.bwc", I get only the option dialog box.
Mark
Al Smith
14th June 2002, 18:15
Hi,
I just loaded B40c.62 Baan client and everything still works. (Wow, the bw.exe went from 1 meg to 6 meg.)
For what it's worth, below is the Object Idents from our system for ottstpoledaem, ottdllsql_query, and ottstpapihand.
Al.
---------------------------OBJECT IDENTS--------------------------------
@(#)/n1/BaanIVc4/bse/tools/ttB40_c4/pttstp/pstpoledaemon0, 98/10/02 [06:18], From bsp
@(#)-DREL6_1
@(#)bic_global 8.2:4/20/98 Copyright (c) Baan International b.v.
@(#)bic_object 7.7.1.2:1/26/98 Copyright (c) Baan International b.v.
@(#)bic_event 8.1:4/20/98 Copyright (c) Baan International b.v.
@(#)bic_shell, 08-1994/R1, Copyright (c) Baan International b.v.
@(#)bic_fork 1.1:3/1/95 Copyright (c) Baan International b.v.
---------------------------OBJECT IDENTS--------------------------------
@(#)/usr4/triton6/bse/tools/ttB40_c5/pttdll/pdllsql_query0, 98/11/13 [10:07], From gvdwal
@(#)-DREL6_1
@(#)bic_global 7.18.1.1:8/31/98 Copyright (c) Baan International b.v.
@(#)bic_object 7.7.1.2:1/26/98 Copyright (c) Baan International b.v.
@(#)bic_event 8.1:4/20/98 Copyright (c) Baan International b.v.
@(#)bic_shell, 08-1994/R1, Copyright (c) Baan International b.v.
@(#)bic_fork 1.1:3/1/95 Copyright (c) Baan International b.v.
@(#)DF 70437 01/09/1998 mb.export removed
@(#) Call 10018477, 96/01/29: Error ; not expected, using date.to.num()
@(#) Call 10020566, 96/04/26: Error if using parenthesis on from/to fld
@(#) Call 10228702, 97/03/10: Error if parenthesis on date fields
@(#) Call 10241698, 97/05/01: Error when using exists
@(#) Call 10242579, 97/05/01: Error when using exists
@(#) Call 11609, 97/07/16: Error when using between
@(#) Call 12796, 97/09/22: Error when using arithmetic on date
@(#) Call 16265, 98/03/24: .date fields disappear from query
@(#) Call 17250, 98/04/08: single quoted strings disappear from query
@(#) Call 17988, 98/05/13: set specification cannot be used
@(#)Call 441214, 1995/06/28
---------------------------OBJECT IDENTS--------------------------------
@(#)/usr4/triton6/bse/tools/ttB40_c5/pttstp/pstpapihand0, 99/02/02 [13:20], From gvdwal
@(#)-DREL6_1
@(#)bic_global 7.18.1.1:8/31/98 Copyright (c) Baan International b.v.
@(#)bic_object 7.7.1.2:1/26/98 Copyright (c) Baan International b.v.
@(#)bic_event 8.1:4/20/98 Copyright (c) Baan International b.v.
@(#)bic_shell, 08-1994/R1, Copyright (c) Baan International b.v.
@(#)bic_fork 1.1:3/1/95 Copyright (c) Baan International b.v.
@(#) October 1997: Added argmuments (do.update) in functions insert/update/delete
@(#) October 1997: Added function get.mess.code
@(#) December 1997: After update/insert new values are taken back
@(#) December 1997: Solved problem with multiple forms
@(#) December 1997: Solved problem with more than 1 session
@(#) April 1998: Session created in separate process group
@(#) DF19590,98/10/05: Baan is not responding after delete action
@(#) December 1998: Update and save action combined in 1 call
@(#) December 1998: Performance improvements
@(#) Februari 1999: Only fields filled with put are read by stp
mark_h
19th June 2002, 13:57
Hi Al!!
Just caught this today when I was going to give an update on the case. Here is the idents from ttstpoledaemon:
---------------------------OBJECT IDENTS--------------------------------
@(#)/usr4/triton6/bse/tools/ttB40_c5/pttstp/pstpoledaemon0, 00/06/19 [15:39], Fn
@(#)-DREL6_1
@(#)bic_global 8.13:6/15/00 Copyright (c) Baan International b.v.
@(#)bic_object 7.7.1.3:2/19/99 Copyright (c) Baan International b.v.
@(#)bic_event 8.2:1/13/00 Copyright (c) Baan International b.v.
@(#)bic_shell, 08-1994/R1, Copyright (c) Baan International b.v.
@(#)bic_fork 1.1:3/1/95 Copyright (c) Baan International b.v.
From ours you can see the differences and that could be the problem.
Anyway this specific case is still in the "waiting" state. What worries me is that I will get the same answer to this case that I got on another. The other case our admin logged had to do with ttstpcreatdll - it no longer works. The response from the support center was to update our porting set, but we can not do this because we are in the middle of working with Baan on data correction. Here is the reponse back from our admin:
BaaN told us that one of the things we needed to do to resolve this case is to install the porting set at level 6.1c.06.xx. The latest level is now at 6.1c.06.04. However, Erica Smit's A&D Newsletter dated May 10 advised us not to upgrade the porting to 6.1c.06.03 or higher since it affects the data clean-up effort.
We have several cases on hold where we can not install patches because of this cleanup effort. It is so frustrating to have the Baan response center give us a solution and then the Baan correction team tell us we can not install it. Sigh. If I ever get a solution I will post it.
Mark
r_nagu
19th June 2002, 16:03
Hi All,
My bic_info6.1 on ottstpoledaemon looks exactly like Marks. I hope upgrading the porting set is not the only solution.
Mark,
You said it used to work on your old BW version. What version was that?
Thanks,
NS
mark_h
19th June 2002, 16:25
Hello NS!
My old bw client was B40c.044. This bw.exe file works with the porting set and tools release we are on. I am keeping this client in another directory so the stuff I need continues to work.
Mark
r_nagu
28th June 2002, 21:00
Hi Mark,
I was just wondering whether you had any luck with this?
Thanks,
NS
mark_h
28th June 2002, 21:33
Hello NS!
Sorry no luck yet. The support sight had us install a solution which had a newer ottdllsql_query. That did not work - same error. Then they emailed me another version of ottdllsql_query. That did not work also, I have not heard back from them since yesterday morning.
Mark
MatthewJames
1st July 2002, 17:48
Have you tried running this code on multiple machines?
to find out if it is machine specific or a genuine bug?
Other wise try fully removing you client installation and re-installing it as this will probably solve the problem if it registry based which it sounds like it is.
What version of excel are you using? have you got the latest service pack?
The code it's self is sound!
mark_h
1st July 2002, 18:07
We just installed W2K and office XP. This works with the old client, but not the new client. I did originally uninstall all clients. I am not sure if that cleaned up the registry. I might give that a try tomorrow.
The same error appears on other machines with the .65 client.
Mark
mark_h
12th July 2002, 22:04
Here is what I was informed of today:
OLE is no longer supported in the B40c.065 client. I was told to keep my .044 client until we upgrade to 5c. In 5c I was told we will use openworld. We are planning to upgrade to 4c4 and what I was provided was a copy of the quick guide(AG1002) for a work around. Not even close to OLE, but I can keep the old client. If you are not familiar with this quick guide it is how to use ttstpconv. Not the same as OLE. So I will hold onto the old client until it no longer works or we go to 5c. Which will not happen until Baan has a 5c A&D version.
Somewhere along the way NS asked "Does BW version matter?" - The answer is YES. Maybe if you had one of the older clients it would work with 4c4 (I think that was the version you all were using). Since I am the only one using OLE at our site I can use the old client work around - not sure if that is feasible for you NS. I had planned on rolling out a function server to a user , but will skip that.
That's the update according to Baan.
Mark
r_nagu
14th July 2002, 16:53
Mark,
Thanks for the update. I guess I will have to dig out one of the old versions of BW and try this OLE.
Thanks,
NS
r_nagu
14th July 2002, 16:54
Mark,
Thanks for the update. I guess I will have to dig out one of the old versions of BW and try this OLE.
Thanks,
NS
Darren Phillips
17th July 2002, 15:15
Mark
When I saw that BAAN support said OLE is no longer supported in the B40c.065 client I was not happy as I have some users making use of this. So I tested the B40c.065 client and on our system it still works BaanIV4 SCH1 SP9. sounds like support cannot find the problem your having so easier to say that it is no longer supported.
mark_h
17th July 2002, 15:38
Darren,
When I think about it I also wonder why they included the "automation" tab on the configurator if the no longer support OLE. Anyway I plan on testing it when we go to 4c4 sometime in the next year. Currently we are on 4c3 A&D SP12. I really thing the problem has something to do with our porting set - but that is a guess. Currently ttstpcreatdll does not work and baan support said we need the new porting set. We need to finish the Data recovery process Baan has us going through right now and can not install patches or a new porting set. I was hoping for a different answer, but will live with the answer they gave me.
Thanks again for the update. I will keep an eye on things to see if it does start working with the new client.
Mark
mark_h
15th August 2002, 16:06
On Monday we updated the porting set on our test box. We installed this to fix a problem I had with the ttstpcreatdll session. Anyway I did think about testing this until this morning. We went from 6.1c.04.01 to 6.1c.06.04 and the OLE automation works. So NS it looks like the client and the porting set could be causing your problem.
Mark