Re: runtime error 3075..
- From: "William \(Bill\) Vaughn" <billvaRemoveThis@xxxxxxxxxx>
- Date: Tue, 19 Jul 2005 10:14:31 -0700
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
> 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
>
>
.
- References:
- runtime error 3075..
- From: Dave@Yacc
- Re: runtime error 3075..
- From: Stephen Howe
- runtime error 3075..
- Prev by Date: Re: Which type of connection to be used in multi-ser environment?
- Next by Date: vb.net code to copy queries and tables from 1 ms access db to anot
- Previous by thread: Re: runtime error 3075..
- Next by thread: Which type of connection to be used in multi-ser environment?
- Index(es):
Relevant Pages
|