Hello,
If I use a OleDBDataAdapter wizard to generate Update and Insert commands on my select that is :
SELECT Product, [Product group], [Main product], [EIS number], Description, [PCB AN], [SMD lot size], [Finished product], [Machine assembly sequence], [Two side SMD] FROM Products
I get the following code for update generated by the wizard:
Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _
"mber] = ?, Description = ?, [PCB AN] = ?, [SMD lot size] = ?, [Finished product]" & _
" = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?) AN" & _
"D (Description = ? OR ? IS NULL AND Description IS NULL) AND ([EIS number] = ? O" & _
"R ? IS NULL AND [EIS number] IS NULL) AND ([Finished product] = ?) AND ([Machine" & _
" assembly sequence] = ? OR ? IS NULL AND [Machine assembly sequence] IS NULL) AN" & _
"D ([Main product] = ? OR ? IS NULL AND [Main product] IS NULL) AND ([PCB AN] = ?" & _
") AND ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) AND ([SMD l" & _
"ot size] = ? OR ? IS NULL AND [SMD lot size] IS NULL) AND ([Two side SMD] = ?)"
Why is this code like ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) genrated? What it actually does?
If I write the update clause myself it would be with a very short where clause (product is a primary key) like:
Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _
"mber] = ?, Description = ?, [PCB AN] = ?, [SMD lot size] = ?, [Finished product]" & _
" = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?)
What is the difference in the functionality in those two different ways of writing the where clause?
I will be glad to get some links that will help me find information about this.
Thanks,
Aleksandar
If I use a OleDBDataAdapter wizard to generate Update and Insert commands on my select that is :
SELECT Product, [Product group], [Main product], [EIS number], Description, [PCB AN], [SMD lot size], [Finished product], [Machine assembly sequence], [Two side SMD] FROM Products
I get the following code for update generated by the wizard:
Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _
"mber] = ?, Description = ?, [PCB AN] = ?, [SMD lot size] = ?, [Finished product]" & _
" = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?) AN" & _
"D (Description = ? OR ? IS NULL AND Description IS NULL) AND ([EIS number] = ? O" & _
"R ? IS NULL AND [EIS number] IS NULL) AND ([Finished product] = ?) AND ([Machine" & _
" assembly sequence] = ? OR ? IS NULL AND [Machine assembly sequence] IS NULL) AN" & _
"D ([Main product] = ? OR ? IS NULL AND [Main product] IS NULL) AND ([PCB AN] = ?" & _
") AND ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) AND ([SMD l" & _
"ot size] = ? OR ? IS NULL AND [SMD lot size] IS NULL) AND ([Two side SMD] = ?)"
Why is this code like ([Product group] = ? OR ? IS NULL AND [Product group] IS NULL) genrated? What it actually does?
If I write the update clause myself it would be with a very short where clause (product is a primary key) like:
Me.OleDbUpdateCommand1.CommandText = "UPDATE Products SET [Product group] = ?, [Main product] = ?, [EIS nu" & _
"mber] = ?, Description = ?, [PCB AN] = ?, [SMD lot size] = ?, [Finished product]" & _
" = ?, [Machine assembly sequence] = ?, [Two side SMD] = ? WHERE (Product = ?)
What is the difference in the functionality in those two different ways of writing the where clause?
I will be glad to get some links that will help me find information about this.
Thanks,
Aleksandar