Solved

Run time error- 3251

Posted on 2001-09-08
8
585 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 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