SQL command error, please help

04-13-2004, 08:06 AM
Hi everyone,

I am trying to figure out what is wrong with this SQL command. I am running a SQL command against an Access table (delete a record), and my SQL command is:

Set conn = New ADODB.Connection
Set recImage = New ADODB.Recordset
Set CMD = New Command

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & App.Path & "\ImageTempLoc.mdb"
recImage.Open "SELECT * FROM ImageLibrary", conn, adOpenStatic, adLockOptimistic, adCmdText
CMD.ActiveConnection = conn
CMD.CommandText = "Delete ImageLibrary Where ImageName =" & Chr$(39) & SmallFileName & Chr$(39)
Set recImage = CMD.Execute

I've got this error message: Syntax error(missing operator) in query expression 'ImageLibrary Where ImageName='c:\temp\test.tif'

Anyone please point out my error. Thanks a lot in advance

04-13-2004, 08:09 AM

DELETE FROM ImageLibrary...

04-13-2004, 08:16 AM

DELETE FROM ImageLibrary...

This is amazing, it did work. Thanks a lot my friend.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum