Solved

Run time error- 3251

Posted on 2001-09-08
8
550 Views
Last Modified: 2012-06-21
I am using vb with oracle 8i (8.1.5) as backend. when i am adding  a new record  using recordset in ADO. i am getting run time error 3251 ( operation requested by the application is not supported by the provider).

what could be the problem ? how to rectify it.


advance thanks

sriram
0
Comment
Question by:sriramh
8 Comments
 
LVL 12

Expert Comment

by:roverm
ID: 6466560
Can you paste the code ?

What I always do is this:

Set rs = cn.Open("Select * from mytable where 1 = 0")

'this will result in an empty recordset, cn is your dynamic connection !

With rs
  .AddNew
  .Fields("firstfield").Value = "my new value"
  .Update
  .Close
End With

Set rs = Nothing

D'Mzzl!
RoverM
0
 
LVL 4

Accepted Solution

by:
VincentLawlor earned 150 total points
ID: 6466588
Have you got the drivers for Oracle installed on the client machine and Oracle client running ?

Latest version of MDAC
http://www.stfb.com/Code/vbcode/mdac_typ.exe

What does your connection string look like ?

For the current Oracle ODBC Driver from Microsoft:

oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
                  "Server=OracleServer.world;" & _
                  "Uid=myUsername;" & _
                  "Pwd=myPassword;"

For the older Oracle ODBC Driver from Microsoft:

oConn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _
                  "ConnectString=OracleServer.world;" & _
                  "Uid=myUsername;" & _
                  "Pwd=myPassword;"

Also have a look at this
http://support.microsoft.com/support/kb/articles/q193/3/32.asp

Vin.
0
 
LVL 2

Expert Comment

by:YourBuddyToo
ID: 6466838
Do you have the approporate security rights to the Oracle database?  Most users are generally configured as read only users and thus not allowed to add new records.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6468981
I suspect you are opening the recordset ReadOnly (the default).  Posting the code should clarify this point.

Anthony
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 9

Expert Comment

by:Valliappan AN
ID: 6470216
Agree with acperkins. Hope you open the rs as readonly.
0
 

Author Comment

by:sriramh
ID: 6470278


Thanks vincent. I am able to insert record. But why i cannot give provider name (Provider=MSDAORA.1)instead of driver name ?


I just tell what is my code ?


Declaration :-

Dim con As ADODB.Connection
Dim cmd As ADODB.Parameter
Dim rs As ADODB.Recordset
Dim sql As String

Form Load :-

Set con = New ADODB.Connection
Set cmd = New ADODB.Parameter
cmd = "Provider=MSDAORA.1;Persist Security Info=True;User ID=system;Password=manager"
Set rs = New ADODB.Recordset
sql = "select * from mytable"
rs.Open sql, con, adOpenDynamic, adLockOptimistic

Procedure in Insert Buton :-

rs.addnew

It is giving run-time error 3251 ( current recordset does not support updating. This may be a limitation of the provider, or of the selected lock type.)


But when i change code in form load like this

cmd = "Driver={Microsoft ODBC for Oracle};User Id=system;Password=manager;Persist Security Info=True"

I am not getting any error mesage in insert procedure (rs.addnew)

Can u tell what could be the problem ?


0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6470310
Doesn't look like you are specifying the server name in your connection string.

This is a known problem with the Microsoft Oracle OLE DB Provider.

You must use client-side cursors to perform updates against an Oracle database by using the Microsoft Oracle OLE DB Provider. To do this, before opening the recordset, specify the CursorLocation property to equal adUseClient (or the number "3").  

rs.CursorLocation = adUseClient

Vin.
0
 
LVL 4

Expert Comment

by:VincentLawlor
ID: 6470323
Meant to say at the start of that message

This error message is generated because the Oracle OLE DB Provider does not support server-side updates.

Vin.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now