Results 1 to 2 of 2

Thread: Action queries with Access, ADO and OLEDB Jet Provider

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Posts
    253

    Unhappy

    Hello,

    1. Can someone tell me what is wrong with this sentence?

    Conn.Execute "DELETE * FROM tblProjects WHERE ProjectNum=" & CLng(ExistingProject)

    "Conn" is declared as Connection, the table exists in the database and the field is in it. However, when I try to execute the line, I get the following error:

    "No value given for one or more required parameters."

    I think that ADO has problems with such sentences, but I can't figure out what I need to do in order to fix that.

    2. I have a problem with another sentence that executes a deletion query:

    Conn.Execute "DELETE * FROM tblNewMesimot WHERE MesimaNum='" & NewMesima & "'"

    This query is one of many queries that I need to execute in a transaction. It executes without errors, but it seems that it prevents from other queries to be executed.

    Explanation: The transaction consists of queries that are executed by using the Execute method of the Connection object and queries that are executed by using the Execute method of the Command object (because they are parameterized queries). When I execute the sentence above (by using the Connection object), all of the queries that are executed by using the Command object don't seem to work! I.E, the transaction is commited without errors but when I check the database tables, I see that the queries have not been executed! When I omit this sentence, everything is OK but I need it as part of the transaction.

    Does anyone know how to solve these problems?

    Thanks!




  2. #2
    Member
    Join Date
    Jan 2000
    Location
    Quantico, VA, USA
    Posts
    41

    Cool

    I can help w/number 1, at least I think I can. I work with ado a lot, and the only time I've recieved that error was when I misspelled either the tablename of the field name. Anything you misspell, ie. that access can't find in the db, it assumes is a parameter. other than that, I didn't see a problem with the SQL or the statement itself. Are you absolutely certain everything is spelled correctly?
    chuck
    To err is human, but to apologize frequently is embarassing.

Posting Permissions

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



Click Here to Expand Forum to Full Width