Solved

Run time error- 3251

Posted on 2001-09-08
8
601 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month4 days, 5 hours left to enroll

630 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