Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - how do I delete lines using SQL?

Status
Not open for further replies.

learning2fly

Programmer
Jan 10, 2001
12
GB
I am attempting to delete lines from an ODBC linked MySQl database using SQL statements from Excel but I am having some difficulty.

The use of the line:

dbData.Execute sqlClear

with the string sqlClear defined as:

sqlClear = "DELETE FROM marketdatapx WHERE network = 'IEEE57' and date1 = " & BidDayFormatted & " and idp = " & GenIDP & ""

Returns an error that I must use an "updateable query".

I have done some research into what might cause this error but seem to have ruled out the most obvious ones:

I have full access to the database

The line is not part of a one to many relationship

Is there anything else it could be?

Thanks
 

First off try to change your delete to a select and see if it returns any records. It should return another error, and what I am thinking it will be due to the format of the date field. I believe you need single ticks around it [tt](')[/tt] or possible another character (like in access the # character).

Just a stab in the dark, Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top