RE: ADO update to VFP database



Try it with a command object instead of a recordset object:

Dim cmd As New ADODB.Command
cmd.ActiveConnection = "Provider=vfpoledb.1;DSN=sbt"
cmd.CommandTimeout = 600
cmd.CommandType = adCmdText
cmd.CommandText = "Update tblx Set itmmemo = 'something' WHERE Item =
'HF02-008-ELLI '"
cmd.Execute
cmd.ActiveConnection.Close

HTH
Rich


"franky" wrote:

> Hello,
>
> I'm attempting to connect to a Visual FoxPro database and make an update.
> I'm able to make the connection but whenever I attempt to make the edit I get
> the following error:
>
> Current Recordset does not support updating. This may be a limitation of
> the proivder, or of the selected locktype
>
> This is a 3rd party VFP8.0 database. Its seems like the record locktype is
> being ignored. Any sugestions? Here is the code i'm executing:
>
> Dim cnn1 As ADODB.Connection
> Dim rstNote As ADODB.Recordset
> Dim strCnn As String
> Dim sql As String
>
>
>
> Set cnn1 = New ADODB.Connection
> strCnn = "Provider=vfpoledb.1;" & _
> "DSN=sbt"
> cnn1.Open strCnn
>
> Set rstNote = New ADODB.Recordset
> Set rstNote.ActiveConnection = cnn1
> rstNote.CursorType = adOpenKeyset
> rstNote.LockType = adLockOptimistic
>
> sql = "SELECT itmmemo " & _
> " FROM icitem01 WHERE Item = 'HF02-008-ELLI '"
>
> rstNote.Open sql
>
> ERROR OCCURS ON THIS STATEMENT
> rstNote!itmmemo = "test"
>
> Thanks in advance.
>
>
.



Relevant Pages

  • Re: access 2003
    ... Dim ctl As Control ... Dim rs As Recordset ... This sets the query definitions for choosing data to create an invoice using ... Event on combo box: Private Sub ChooseCust_AfterUpdate ...
    (microsoft.public.access.conversion)
  • Re: Help Getting .RecordCount from Stored Proc
    ... I am using VB 6 to execute a stored proc, ... I created a connection, command, and recordset with ADO. ... > Dim cnn1 As ADODB.Connection ... > Dim cmdProvider As ADODB.Command ...
    (microsoft.public.vb.database.ado)
  • Re: A simple problem with MoveFirst
    ... update the table (rather than using the recordset) means that from ADO's ... Dim tbDataToBeEmailed As ADODB.Recordset ... tbDataToBeEmailed.Open "tbDataToBeEmailed", cnCurrent, adOpenKeyset, ... "You have not entered time into the ACIS ...
    (microsoft.public.access.modulesdaovba)
  • Re: macro error due to editor
    ... Your VBA code never sets DB or the Recordset variables to Nothing. ... Do you declare DB as a global variable anywhere in the database file (e.g., ... EmpDateAs String ... Dim DB As Database, Qry As QueryDef, Qry_def As String ...
    (microsoft.public.access.macros)
  • Re: DAO MUCH faster than ADO in this test
    ... DAO is well-known to be faster than ADO. ... Of course the DAO loop ran faster than the SQL loop; ... advantage of a table-type recordset, which only works on local tables. ... Dim starttime As Single, finishtime As Single ...
    (microsoft.public.access.modulesdaovba)