Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Basic + Interbase : Addnew Error

Status
Not open for further replies.

dbdfs

Programmer
Jan 15, 2002
3
MT
I am using Visual Basic to connect to Interbase. The connection worked but when I try adding a new record
the following error occurs :

Runtime Error '3251':
Object or provider is not capable of performing requested operation.


This is the Visual Basic code I'm using

'Setting & opening the connection

Dim adoConn As New ADODB.Connection

Set adoConn = New ADODB.Connection
adoConn.ConnectionString = "provider=IbOLEdb.1;data source=localhost:C:\Program Files\Borland\InterBaseIB_Tutorial\Tutorial.gdb;ctype=win1251;user id=SYSDBA;password=masterkey"
adoConn.Open

Private Sub TEST()
Dim RS As New ADODB.Recordset, SqlStr as string

SqlStr = "SELECT * FROM Country"
RS.CursorLocation = adUseClient
Set RS = New ADODB.Recordset
RS.Open SqlStr, adoConn, adOpenStatic,
adLockBatchOptimistic

With RS
.AddNew ****** ERROR **********
![country] = "Malta"
![Currency] = "Lm"
.Update
.Close
End With
Set RS = nothing
End Sub

I would appreciate any help !!

Thanks

 
Try removing the 'RS.cursorlocation' line. Usually the cursor location is set with the connection object and not the recordset. Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top