Microsoft KB Archive/277136

= Cannot Read Errors That Coming from Oracle Provider =

Article ID: 277136

Article Last Modified on 2/25/2004

-

APPLIES TO


 * Microsoft Commerce Server 2002 Standard Edition
 * Microsoft Commerce Server 2000 Standard Edition

-



This article was previously published under Q277136



SUMMARY
When a profile data source is mapped to an Oracle database, error message information is not returned in the Errors collection of the Commerce OLE DB provider if an error occurs in the Oracle data source. This is a limitation of the Oracle provider, and not the Commerce OLE DB provider.



MORE INFORMATION
The following code can reproduce this behavior when you use a profile data member contained in Oracle.

Note In the following sample code, you must change uid=  and pwd=  to the correct values. Make sure that the user ID has the appropriate permissions to perform this operation on the database. On Error Resume Next

ProfileName = &quot;test&quot; ProfileType = &quot;Users&quot;

ConnStr = &quot;Provider=CSOLEDB;Server=MyServer;Database=Retail_Commerce;uid= ;pwd= &quot; Catalog = &quot;Profile Definitions&quot;

Set objProfileSvc = CreateObject(&quot;Commerce.ProfileService&quot;) objProfileSvc.Initialize ConnStr, Catalog if err.number <> 0 then errstr = &quot;Errors for Initialize: &quot; & vbcrlf set objerr = objprofileSvc.Errors

for each er in objerr errstr = errstr & &quot;Num: &quot; & er.number & &quot; Desc: &quot; & er.description next wscript.echo errstr end if

Set objProfile = objProfileSvc.CreateProfile(ProfileName, ProfileType ) if err.number <> 0 then errstr = &quot;Errors for Create profile: &quot; & vbcrlf set objerr = objprofileSvc.Errors for each er in objerr errstr = errstr & &quot;Num: &quot; & er.number & &quot; Desc: &quot; & er.description next wscript.echo errstr end if

'Set the property value field = &quot;name&quot; objProfile.fields(field).Value = ProfileName

field = &quot;mynumber&quot; ' this is too big for the column to hold objProfile.fields(field).Value = 1234567 objProfile.update

if err.number <> 0 then errstr = &quot;Errors for Update: &quot; & vbcrlf set objerr = objprofileSvc.Errors for each er in objerr errstr = errstr & &quot;Num: &quot; & er.number & &quot; Desc: &quot; & er.description next wscript.echo errstr end if

set objProfile = Nothing

Set objProfile = objProfileSvc.GetProfile(ProfileName, ProfileType ) if err.number <> 0 then errstr = &quot;Errors for GetProfile: &quot; & vbcrlf set objerr = objprofileSvc.Errors for each er in objerr errstr = errstr & &quot;Num: &quot; & er.number & &quot; Desc: &quot; & er.description next wscript.echo errstr else ' display the value name = objProfile.fields(field).name type1 = objProfile.fields(field).type value = objProfile.fields(field).value wscript.echo &quot;Name: &quot; & name & vbcrlf wscript.echo &quot;type: &quot; & type1 & vbcrlf wscript.echo &quot;Value: &quot; & value end if

' delete it objProfileSvc.deleteProfile ProfileName, ProfileType

wscript.echo &quot;finished&quot; The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Additional query words: cs2k csoledb oracle provider

Keywords: kbinfo kbpending KB277136

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.