Re: runtime error 3075..



Stephen is right on. I suggest you use a Command object to manage this
action command. It will deal with the framing quotes you need around the
"Del" parameter. If you insist on an ad hoc style like this you need to add
the single quotes around "Del"

...WHERE EmailAddress = ' & Del & "' "

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________

"Stephen Howe" <stephenPOINThoweATtns-globalPOINTcom> wrote in message
news:%23wgzZYFjFHA.3316@xxxxxxxxxxxxxxxxxxxxxxx
>> I keep getting a runtime error ...
>
> Please post the runtime error, word verbatim next time.
>
>> that says missing syntax on this piece of code, its driving me insane!
>> I've tried passing allsorts to the query, even manually typing the record
> i want to delete but it has no >effect!
>>
>> any ideas?
>
> You could change the SQL command
>
>> DoCmd.RunSQL "DELETE FROM email_Send WHERE EmailAddress =" & Del
>
> so that as string is passed to DoCmd.RunSQL. That gives you chance to
> print
> the SQL command.
>
> But I suspect that your problem is with what Del contains. I am assuming
> that EmailAddress is a character field. It may contain single-quote
> characters and for SQL that is the escape chracter and needs doubling up
> for the above to work. Or it may lack start and end single-quote
> characters.
> They are not optional FROM is optional for DELETE command.
> So
>
> DELETE email_Send WHERE EmailAddress ='Cedar Street'
> DELETE email_Send WHERE EmailAddress ='O''Malley Street'
>
> Notice for "O'Malley Street" the single-quote character embedded within
> has
> been repeated twice. That is essential for character fields. Notice also
> the
> start and end single-quote characters. They are essential.
> "Cedar Street" does not have any embedded single-quote characters so all
> it
> has the start and end single-quote characters marking the start and end of
> the string.
>
> I would also suggest that when an application of yours is falling over on
> trying to execute SQL, you post the SQL it is falling over on here.
>
> Stephen Howe
>
>


.



Relevant Pages

  • Quote problem
    ... # set $t to some sql preceded by a -Q flag. ... another command obviously. ... Notice the single-quote at the end of SELECT and at the beginning of ... sqlcmd is a command line interface to sql ...
    (comp.unix.shell)
  • Re: newbie isql help
    ... I'm using Solaris 8 as the OS and ASE 12.5.3 as the SQL server. ... I tried to run the command directly by logging in but my SQL command is ... At the isql prompt, how do I seek help for the isql commands available ... which collectively are much bigger than 5030 characters into isql, ...
    (comp.databases.sybase)
  • Re: COBOL stored procedure for DB2
    ... Regarding how you precompile the app, you must specify target mfcob to db2 prep, rather than target ibmcob. ... Have you also confirmed that, prior to executing the CALL statement, the host variables specified within the client app have the appropriate values? ... MODIFIES SQL DATA ... confirm the cob command used for creating the SP module. ...
    (comp.lang.cobol)
  • Re: Set App Priority
    ... string and then terminates" ... gives then parameters to use to modify the START command ... below) /F:OFF Disable file and directory name completion characters ... no special characters between the two quote characters, ...
    (microsoft.public.windowsxp.customize)
  • Re: Set App Priority
    ... This would start notepad with high priority. ... Starts a new instance of the Windows XP command interpreter ... /F:OFF Disable file and directory name completion characters ... If all of the following conditions are met, then quote characters ...
    (microsoft.public.windowsxp.customize)

Quantcast