Microsoft KB Archive/238849

= PRB: Numbered Positioned Updates Against Oracle8i Database Server Fails =

Article ID: 238849

Article Last Modified on 12/5/2003

-

APPLIES TO


 * Microsoft Data Access Components 2.1
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.5
 * Microsoft Open Database Connectivity 2.0

-



This article was previously published under Q238849



SYMPTOMS
When you attempt to update or insert records into an Oracle8i server by using a NUMBER(x,y) datatype field, you receive the following error:

[Microsoft][ODBC Driver for Oracle][Oracle]ORA-01722: invalid number



CAUSE
The Microsoft Oracle ODBC Driver incorrectly parses for the decimal separator when connecting to an Oracle8i server.



RESOLUTION
The current versions of the Microsoft Oracle Open Database Connectivity (ODBC) Driver and OLE DB Providers were not supported in an Oracle8i environment. Use the Microsoft OLE DB Provider for Oracle to work around this INSERT problem; however, you may run into other incompatibilities. You may also hard code the INSERT and UPDATE statements and run them off the command object.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
The following Visual Basic code shows the problem. The Oracle server must be an 8i server or the error does not occur. Place the code in the Visual Basic Form_Load method. Make sure to add the Microsoft ActiveX Data Objects 2.1 Library on the Project, References menu. Dim cn As New Connection, rs As New Recordset strTable = "ztest" 'Using the OLEDB Provider instead of the ODBC Driver 'allows you to get around this "invalid number" error, i.e.   'cn.ConnectionString = "Provider=MSDAORA.1;Password=yourpwd;User ID=yourUID;Data Source=myDSN;" cn.ConnectionString = "Provider=MSDASQL.1;Password=yourpwd;User ID=yourUID;Data Source=myDSN;" cn.Open On Error Resume Next cn.Execute "drop table " & strTable On Error GoTo 0 cn.Execute "Create Table " & strTable & "(FNUMB NUMBER(38, 4) NULL, PrimaryKey NUMBER(19, 0) PRIMARY KEY)" rs.CursorLocation = adUseClient rs.Open strTable, cn, adOpenKeyset, adLockOptimistic rs.AddNew rs.Fields("fnumb").Value = 22.22 rs.Fields("PrimaryKey").Value = 1 rs.Update                      '<-- error! (invalid number)

Keywords: kboracle kbdatabase kbprb kbdriver KB238849

-

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

© Microsoft Corporation. All rights reserved.