on 08-19-2004 9:08 AM
I have written a middle-ware wrapper which allows me to call a SAP RFC from SQL Server stored procedures. I am upgrading it from the DCOM to the .Net connector so I can run it on Windows 2003 Server.
When I set a string value (SAP C type) to initial I get the error "Object reference not set to an instance of an object." raised in the proxy object. This error does not happen for non-initial values, and also does not happen on my development workstation. It happens if I set the string to "" or to " ". It occurs on two servers - Windows 2000 and Windows 2003.
I can't figure out how to debug this, and can't find anything in this forum or on SAP Notes. Has anyone else found this error?
Setting a value to a string member will always work if the containing structure is a valid object. Please check if the structure reference is null?
Can you paste a piece of your code?
Regards,
Guanwgei
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A clear head in the morning makes all the difference. There was no problem with the .Net Connector.
The problem lay with SQL Server's sp_OAMethod procedure, or possibly in the .Net component's CCW. If you pass an empty string in as an argument, your component gets a Nothing. I therefore fixed it in the component with:
If Value Is Nothing Then Value = ""
Thanks,
Derek
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.