Re: nesting text functions when writing to an access 2000 db



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.


.



Relevant Pages

  • SQL string error message
    ... "runtime error 3078 the microsoft Jet database engine cannot find the input ... Dim db As DAO.Database ... Dim qry As QueryDef ... Dim strSQL As String ...
    (microsoft.public.access.formscoding)
  • Error while executing a sql statement via connection string.
    ... Microsoft JET Database Engine ... THE FOLLOWING IS THE CODE OF THE SQL STATEMENT GETTING UPDATED. ... when I am doing a response.write strsql the following is the ... UPDATE tblApplication SET ProjTitle = 'Helping the Homeless', ...
    (microsoft.public.inetserver.asp.db)
  • Re: I need help with a ASP Error
    ... > Sub GetManagerDetails ... > strSQL was in fact ok. ... > Microsoft JET Database Engine error '80040e14' ...
    (microsoft.public.inetserver.asp.db)
  • Re: SQL Error on INSERT
    ... > Error Type: ... > Microsoft JET Database Engine ... Any text values must be wrapped in single quotes. ...
    (microsoft.public.inetserver.asp.db)
  • Not able to open remote mdb files from asp
    ... I have a shared mdb file. ... Error Type: ... The Microsoft Jet database engine cannot open the ...
    (microsoft.public.inetserver.iis.security)

Quantcast