OLE DB/ADO/ORACLE: Accessor is not a parameter accessor
Date: Thu, 18 Jan 2001 02:39:52 GMT
Message-ID: <945l1n$54l$1_at_nnrp1.deja.com>
I'm using VBScript and ADO to access an Oracle 8i (8.1.6) database. When I run the following script, I get an error stating "Accessor is not a parameter accessor" (error #80040E4B). Can anyone confirm that this error occurs on their system or offer any suggestions to solve the problem? This error occurs only with specific data in the table.
To create and populate the table:
DROP TABLE DUH; CREATE TABLE DUH
(
NUMERIC_VALUE FLOAT NULL
);
INSERT INTO DUH VALUES ( NULL ); INSERT INTO DUH VALUES ( NULL ); INSERT INTO DUH VALUES ( 3.0 ); INSERT INTO DUH VALUES ( 4.0 ); INSERT INTO DUH VALUES ( 5.0 ); INSERT INTO DUH VALUES ( 6.0 ); INSERT INTO DUH VALUES ( 7.0 ); INSERT INTO DUH VALUES ( 8.486 ); INSERT INTO DUH VALUES ( 9.0 );
COMMIT;
The sample VBScript:
'-----------------------------------------------------Dim g_objConnection
Sub OpenDatabase()
Dim strConnectString, strUsername, strPassword
strConnectString = "Provider=OraOLEDB.Oracle" _
& ";Persist Security Info=False" _
& ";Data Source=TEST"
strUsername = "<username>" strPassword = "<password>" Set g_objConnection = CreateObject( "ADODB.Connection" )g_objConnection.Open strConnectString, strUsername, strPassword
End Sub
Function Query()
Dim strSQL
Dim objRS
strSQL = "SELECT AVG( Numeric_Value ) Result FROM Duh"
Set objRS = CreateObject( "ADODB.Recordset" )
objRS.Open strSQL, g_objConnection
If objRS.EOF Then
Query = 0
Else
Dim dblResult dblResult = objRS.Fields( "Result" ).Value WScript.Echo "It worked!" If IsNull( dblResult ) Then Query = 0 Else Query = Round( CDbl( dblResult ), 2 ) End If
End If
objRS.Close
Set objRS = Nothing
End Function
OpenDatabase
WScript.Echo Query()
'-----------------------------------------------------
Configuration:
Oracle 8i 8.1.6
MDAC 2.5
Windows NT 4.0 SP6
Windows Script Host 5.5
Sent via Deja.com
http://www.deja.com/
Received on Thu Jan 18 2001 - 03:39:52 CET