Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2006
    Posts
    115

    Unanswered: Query cannot be updated because the FROM clause is not a single simple table name.

    I have a # temp table and want to insert the record thru vb ado control but fail. pls advise how to use recordset.update to update against # temp table.

    e.g
    Dim ars As New ADODB.Recordset

    ars.CursorLocation = adUseServer
    ars.Open "#email", <connenction>, adOpenKeyset, adLockOptimistic, adCmdTable

    ars.AddNew
    ...
    ars.update
    ==> the following error msg return
    "Query cannot be updated because the FROM clause is not a single simple table name."

  2. #2
    Join Date
    Apr 2010
    Location
    Charlotte, NC
    Posts
    11
    I'm new to this forum, but I think i can help.

    Can you post your update SQL statement you're using in your code? I believe you may have a JOIN statement in there, and the parser is getting confused on which table it should actually be performing the update on.


    ---
    Shannon Lowder
    Database Engineer
    ToyboxCreations

  3. #3
    Join Date
    Jul 2006
    Posts
    115
    it's a visual basic coding to using ADO component & this example is only to read a temp table/#email .. no any other table joining ...

  4. #4
    Join Date
    Apr 2010
    Location
    Charlotte, NC
    Posts
    11
    In the SELECT statement that builds the dataset, does the query have any query hints, like NOLOCK, ROWLOCK, etc?
    ---
    Shannon Lowder
    Database Engineer
    http://toyboxcreations.net

  5. #5
    Join Date
    Apr 2010
    Location
    Charlotte, NC
    Posts
    11
    Actually, does your ado object have any locks set at all?
    ---
    Shannon Lowder
    Database Engineer
    http://toyboxcreations.net

  6. #6
    Join Date
    Jul 2006
    Posts
    115
    According to MS, ado object use adLockOptimistic as lock mode &
    adLockOptimistic => Optimistic LockType

    regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •