Forest Dragon
Sep 26th, 2000, 02:30 PM
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!
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!