Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Run time error- 3251

Posted on 2001-09-08
8
Medium Priority
?
634 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 450 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

877 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