I want to delete all customers that have a blank CompanyName in a remote database
I cannot do it.
I can carry out the deletion in the current database like that:
Dim bas As String
bas = ” DELETE Customers.*, Customers.CompanyName FROM Customers WHERE
(((Customers.CompanyName) Is Null))”
CurrentDb.Execute bas
Then all customers that have a blank company name are deleted.
However,i tried in vain to delete them in a remote database
the function i have made gives no error, but the customers with blank Company Name
are not deleted :
Public Function DeleteCustomersInRemoteDB()
Dim db As DAO.Database
Dim StrPassword As String
StrPassword = “oil”
Set db = DBEngine.Workspaces(0).OpenDatabase(BEpath, dbDriverComplete, False, “;
PWD=” & StrPassword)
Dim bas As String
bas = ” DELETE Customers.*, Customers.CompanyName FROM Customers WHERE
(((Customers.CompanyName) Is Null))”
db.Execute StrSQL
End Function
It is very strange,because a simlar function for updating does work:
Public Function Changeaffiliate()
Dim db As DAO.Database
Dim StrPassword As String
StrPassword = “secret”
Set db = DBEngine.Workspaces(0).OpenDatabase(BEpath, dbDriverComplete, False, “;
PWD=” & StrPassword)
Dim StrSQL As String
StrSQL = “UPDATE bank SET affiliate = 3333 WHERE bankid = 1”
db.Execute StrSQL
End Function
I cannot explain myself why it happens.Can somebody help me ?