Re: nesting text functions when writing to an access 2000 db
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 16:31:10 -0400
Kevin wrote:
> Thanks Bob.
>
> here is the error I get.
>
> ==============================================
> Error Type:
> Microsoft JET Database Engine (0x80040E14)
>
> Error Type:
> Microsoft JET Database Engine (0x80040E14)
> Syntax error (missing operator) in query expression ''Will you create
> a stop by the OCLC booth #2201 during your trip to ALA sort of
> listserv announcement, please? I'm going to be on the booth on
> Saturday and Monday and I would like for folks to know a Western
> representative will be there to answer any que'.
> /wlnweb/comm/assignRequestFind.asp, line 340
> ==============================================
>
> line 340 is ---- objCmd.Execute
>
> I am going to follow up on your other suggestions re: use of
> parameters
>
> I also did try a Response.Write strSQL statement write before the
> objCmd.Execute as such:
>
> Dim objCmd
> Set objCmd = Server.CreateObject("ADODB.Command")
> Set objCmd.ActiveConnection = cnnSimple
> objCmd.CommandText = strSQL
> objCmd.CommandType = adCmdText
> Response.Write strSQL
> objCmd.Execute
> %>
>
> but when I include an apostrophe in the notes field -- I get the
> above error but nor strSQL wrote out -- so I am missing something on
> that trick.
>
Prevent the error by using "response.End" (no quotes of course). Your goal
during this debug phase is to see string contained by the strSQL variable,
not attempt to run the query.
Actually, you should have your string completely built BEFORE creating and
opening the connection. Your other goal should be to have your connection
open for as short a time as possible.You should rearrange your code as
follows:
dim strSQL
strSQL = "UPDATE ..."
'******************************************
'comment/delete these two lines when finished debugging
Response.Write strSQL
Response.End
'******************************************
Dim cnnSimple
etc.
Bob Barrows
PS. Here's a couple more links about using saved parameter queries:
http://www.google.com/groups?selm=eETTdnvFDHA.1660%40TK2MSFTNGP10.phx.gbl&oe=UTF-8&output=gplain
http://www.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=e6lLVvOcDHA.1204%40TK2MSFTNGP12.phx.gbl
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
.
- References:
- Re: nesting text functions when writing to an access 2000 db
- From: Bob Barrows [MVP]
- Re: nesting text functions when writing to an access 2000 db
- Prev by Date: Re: nesting text functions when writing to an access 2000 db
- Previous by thread: Re: nesting text functions when writing to an access 2000 db
- Index(es):
Relevant Pages
|