Solved

Run time error- 3251

Posted on 2001-09-08
8
558 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

920 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

15 Experts available now in Live!

Get 1:1 Help Now