Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
RecordSet problem - Help!
Message
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
RecordSet problem - Help!
Divers
Thread ID:
00630256
Message ID:
00630256
Vues:
49
I'm getting the error 'Recordset does not support updating'. Here's
my code.

My connection code is:



sConnectString = "Provider=Microsoft.Jet.OLEDB.4.0;Data _ Source=D:\Projects\Marketing\Data\3k.mdb;Persist Security Info = False"

Set oConn = New ADODB.Connection
oConn.Open sConnectString


The error occurs when I run this (On the AddNew line):

Set oDetails = OpenTable(oConn, "order_details")

With oOrdDetRecs
  .AddNew
  !OrderId = iOrderId
  !ProductId = cboParts(iRow).GetItemId()
  !Quantity = txtQuantity(iRow).Text
  !Price = Val(lblPrice(iRow).Caption)
  !Subtotal = iQuantity * yPrice
  .Update
End With


The OpenTable function is here:



Public Function OpenTable(oConn As ADODB.Connection, sTableName As String) As ADODB.Recordset

  ' Create a record set
  Set oRecSet = New ADODB.Recordset

  With oRecSet

    ' Assign the record set properties
    .ActiveConnection = oConn
    .CursorType = adOpenKeyset
    .LockType = adLockOptimistic
    .CursorLocation = adUseServer

    ' Open the record set
    .Open sTableName

  End With

  ' Return the record set object
  Set OpenTable = oRecSet

End Function


Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform