SQL command error, please help

Webber
04-13-2004, 09: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"
conn.Open
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

00100b
04-13-2004, 09:09 AM
Use

DELETE FROM ImageLibrary...

Webber
04-13-2004, 09:16 AM
Use

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