Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SQL Delete Record using Excel VBA
I have no problem reading, writing and counting from a table using this VBA /
SQL connection, but when I try to delete a record it does nothing. Any suggestions would be welcome. Sometimes I get nothing, but lately I've been getting a 1004 'General ODBC error.' Thanks, Steve Here's my code: Dim SH As Object Set SH = Sheet1 With SH.Range("Query_from_Loewenpr").QueryTable .Connection = "ODBC;DSN=loewenpr;" .CommandText = Array( _ "DELETE FROM DBPR.DHXSLRTLIB.DHLOC " & _ "WHERE DHLOC.BUSINESS_UNIT = '" & "DHTEST" & _ "')" _ ) .BackgroundQuery = False .Refresh BackgroundQuery:=False End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to delete duplicate record | Excel Programming | |||
find last record in macro and delete all after | Excel Programming | |||
delete record based on a value | Excel Programming | |||
How To Delete First Record In A Text File | Excel Programming | |||
delete record using Macro in excel spreed sheet | Excel Programming |