document's http://www.aspfaq.com/show.asp?id=2035 Then see http://www.aspfaq.com/show.asp?id=2109 Ray at work "Jim in Arizona" wrote in message news:phx.gbl...[ref] > > Error Type: > Microsoft JET Database Engine (0x80040E14) > Syntax error (missing operator) in query expression ''[/ref] [ref] > The thing to avoid the most is the use of META tags to represent > information which should be contained in pre-defined tags. For example, > the document's title should not be placed into a META tag'. > /sugbox.asp, line 20 > > > Conn.Execute("INSERT INTO suggestions VALUES('"& team &"','"& location > &"','"& sug &"','"& Now() &"')") > > Below is the full code for the ASP page and the HTML page with the form.[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => <#T07ADUkEHA.784@TK2MSFTNGP15.phx.gbl> [ref] => [htmlstate] => on_nl2br [postusername] => Ray [ip] => [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 2 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> document's > http://www.aspfaq.com/show.asp?id=2035 > > Then see http://www.aspfaq.com/show.asp?id=2109 > > Ray at work > > > > "Jim in Arizona" wrote in message > news:phx.gbl...[ref] >> >> Error Type: >> Microsoft JET Database Engine (0x80040E14) >> Syntax error (missing operator) in query expression ''[/ref] >[ref] >> The thing to avoid the most is the use of META tags to represent >> information which should be contained in pre-defined tags. For example, >> the document's title should not be placed into a META tag'. >> /sugbox.asp, line 20 >> >> >> Conn.Execute("INSERT INTO suggestions VALUES('"& team &"','"& location >> &"','"& sug &"','"& Now() &"')") >> >> Below is the full code for the ASP page and the HTML page with the form.[/ref] > >[/ref] [allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => <#T07ADUkEHA.784@TK2MSFTNGP15.phx.gbl> [htmlstate] => on_nl2br [postusername] => Jim [ip] => tiltowait@hotma [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 4 [islastshown] => [isfirstshown] => [attachments] => [allattachments] => ) --> HTM Form Post into Access 2K Database - Copy/Paste causing error! - ASP Database

HTM Form Post into Access 2K Database - Copy/Paste causing error! - ASP Database

I'm running into an odd and difficult to track error. This is an internal website suggestion box. The database is an access 2000 database with a single table. the access database has four columns for team, location, suggestion and date. The suggestion field is a memo field. The date field is a short date field. In most cases, the data posts just fine when people fill in the fields on the posting webpage and hit the submit button. I am running into an error when I copy and past text. I can't seem to narrow down what the problem is ...

  1. #1

    Default HTM Form Post into Access 2K Database - Copy/Paste causing error!


    I'm running into an odd and difficult to track error.

    This is an internal website suggestion box.

    The database is an access 2000 database with a single table. the access
    database has four columns for team, location, suggestion and date. The
    suggestion field is a memo field. The date field is a short date field.

    In most cases, the data posts just fine when people fill in the fields on
    the posting webpage and hit the submit button. I am running into an error
    when I copy and past text. I can't seem to narrow down what the problem is
    exactly though. It happens when some text is posted but doesn't happen on
    other occasions. When I copy and past text from a web page, for instance, it
    will give this error. When I copy text from a word doent and paste it
    into the suggestion field, it doesn't error. If I copy text from a website
    into a word doent then copy and past from the word doent into the
    suggestion field, it will give the same error. Here is the error I get:

    ======================= BEGIN ERROR INFORMATION =======================


    The page cannot be displayed
    There is a problem with the page you are trying to reach and it cannot be
    displayed.

    --------------------------------------------------------------------------------

    Please try the following:

    Click the Refresh button, or try again later.

    Open the exfs home page, and then look for links to the information you
    want.
    HTTP 500.100 - Internal Server Error - ASP error
    Internet Information Services

    --------------------------------------------------------------------------------

    Technical Information (for support personnel)

    Error Type:
    Microsoft JET Database Engine (0x80040E14)
    Syntax error (missing operator) in query expression ''The thing to avoid the
    most is the use of META tags to represent information which should be
    contained in pre-defined tags. For example, the doent's title should not
    be placed into a META tag'.
    /sugbox.asp, line 20


    Browser Type:
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

    Page:
    POST 349 bytes to /sugbox.asp

    POST Data:
    team=MIF&location=Not+Selected&suggestion=The+thin g+to+avoid+the+most+is+the+use+of+META+tags+to+rep resent+information+which+should+be+contained+in+pr e-defined+tags.+For+example%2C+the+doent%27s+ti
    .. .

    ======================= END ERROR INFORMATION =======================

    I do not know what it is referring to when it says "missing operator". I
    copied and pasted that text from
    http://www.cwru.edu/help/interHTML/ch3.html. Line 20 (In my ASP page code)
    is this (my Conn.Execute string):

    Conn.Execute("INSERT INTO suggestions VALUES('"& team &"','"& location
    &"','"& sug &"','"& Now() &"')")


    Anyone have a clue?

    Below is the full code for the ASP page and the HTML page with the form.

    Thanks,
    Jim



    ======================= ASP CODE (vb code only)=======================

    <%

    Dim Conn,team,location,sug

    team = Request.Form("team")
    location = Request.Form("location")
    sug = Request.Form("suggestion")

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
    server.mappath("sugbox.mdb")
    Conn.Execute("INSERT INTO suggestions VALUES('"& team &"','"& location
    &"','"& sug &"','"& Now() &"')")

    %>

    ======================= HTM Doent =======================

    <html>
    <head>
    <title>Suggestion Box</title>
    </head>

    <body bgcolor="#800000">
    <table border="0" align="center" width="100%" bgcolor="#ffffff"
    cellspacing="0" cellpadding="0"><tr><td>
    <center>
    <font face="Bookman Old Style" size="5" color="#800000"><b><i>Online
    Suggestion Box</i></b></font>
    </center>

    <img src="images/fadebar.gif" alt="Fade Bar" width="100%" height="10"
    border="0" align="middle">

    <table border="0" cellspacing="0" cellpadding="15">
    <tr><td>
    <font face="Arial" size="2" color="#800000"></font>
    </td></tr>
    </table>
    <table border="0" bordercolor="#800000" cellpadding="15" cellspacing="20"
    align="center" width="95%">
    <tr><td>
    <form method="post" action="sugbox.asp">

    <font face="Arial" size="3" color="#800000"><b>What team is this suggestion
    for?</b><font size="1">(required)</font></font></font><br>
    <input type="radio" name="team" value="MIF" checked><font face="Arial"
    size="2" color="#800000">Management of Information Forum
    (MIF)</font></input>
    <br>
    <input type="radio" name="team" value="ESW"><font face="Arial" size="2"
    color="#800000">Employee Satisfaction Workgroup (ESW)</font></input>
    <br>
    &nbsp;&nbsp;&nbsp;<font face="Arial" size="1" color="#000000"><a
    href="mifesw.htm" target="_blank">What is MIF & ESW?</a></font>
    </td>
    <td>
    <font face="arial" size="3" color="#800000"><b>Location</b></font><br>
    <select name="location" size="1">
    <option value="Not Selected" SELECTED>Select Facility (Optional)</option>
    <option value="Downtown">Downtown Facilities (120/102/107/139)</option>
    <option value="Cottonwood">Cottonwood Facilities (210/222)</option>
    <option value="McCartney">McCartney Facility</option>
    <option value="Peart">Peart Complex (1/3/4)</option>
    <option value="Sunlife">Sunlife</option>
    <option value="CBAT Res">CBAT Residential</option>
    <option value="Hagen Hill">Hagen Hill</option>
    <option value="Broad St Downtown">Broad Street (Downtown)</option>
    <option value="Broad St Napa">Broad Street (By Napa)</option>
    <option value="Hab Any County">Habilitation (Any County)</option>
    </select>
    </td></tr>
    </table>


    <font face="arial" size="3" color="#800000"><b>Suggestion</b></font><br>

    <textarea rows="3" cols="75" name="suggestion"></textarea><br>
    <input type="submit" name="submit" value="Post Your Suggestion">

    </form>

    </td></tr></table>
    </body>
    </html>



    Jim Guest

  2. #2

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    -----> doent's
    http://www.aspfaq.com/show.asp?id=2035

    Then see http://www.aspfaq.com/show.asp?id=2109

    Ray at work



    "Jim in Arizona" <com> wrote in message
    news:phx.gbl... 
     


    Ray Guest

  3. #3

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    > So, if people want to use an aprostrophe, there's nothing I can do about
    it?

    ???

    If people enter an apostrophe into an HTML form, and they submit that form
    to an ASP page, yes of course there is something you can do about it.

    Did you read http://www.aspfaq.com/2035 ???


    Aaron Guest

  4. #4

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    So, if people want to use an aprostrophe, there's nothing I can do about it?
    The process will error on them and there's no way around it?



    "Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
    message news:%phx.gbl... 

    >
    >[/ref]


    Jim Guest

  5. #5

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    After reading that article, multiple times, I was not able to find the
    solution.

    In this code, where would I place the extra aprostrophe(s) to prevent an
    error when an employee uses an apostrophe in the form?

    Conn.Execute("INSERT INTO suggestions VALUES('"& team &"','"& location
    &"','"& sug &"','"& Now() &"')")

    Thanks all for your help.

    Jim




    "Aaron [SQL Server MVP]" <noraa> wrote in message
    news:phx.gbl... 
    > it?
    >
    > ???
    >
    > If people enter an apostrophe into an HTML form, and they submit that form
    > to an ASP page, yes of course there is something you can do about it.
    >
    > Did you read http://www.aspfaq.com/2035 ???
    >
    >[/ref]


    Jim Guest

  6. #6

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    > After reading that article, multiple times, I was not able to find the 

    Seriously now...
     

    team = replace(team, "'", "''")
    location = replace(location, "'", "''")
    sug = replace(sug, "'", "''")

    sql = "INSERT INTO suggestions VALUES('" & team & "','" & location & "','" &
    sug & "', NOW())"

    conn.execute sql, , 129

    --
    http://www.aspfaq.com/
    (Reverse address to reply.)


    Aaron Guest

  7. #7

    Default Re: HTM Form Post into Access 2K Database - Copy/Paste causing error!

    After everyone's help, this was my final code and it appears to work
    flawlessly!

    <%

    Dim Conn,team,location,sug

    team = Request.Form("team")
    location = Request.Form("location")
    sug = Request.Form("suggestion")

    team=replace(team,"'","''")
    location=replace(location,"'","''")
    sug=replace(sug,"'","''")


    Set Conn = Server.CreateObject("ADODB.Connection")

    Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
    server.mappath("sugbox.mdb")

    sql=("INSERT INTO suggestions VALUES('"& team &"','"& location &"','"& sug
    &"','"& Now() &"')")

    Conn.Execute sql,,129

    %>

    Thanks Aaron, Ray and all those who pitched in to help me.

    Jim



    "Aaron [SQL Server MVP]" <noraa> wrote in message
    news:phx.gbl... 
    >
    > Seriously now...

    >
    > team = replace(team, "'", "''")
    > location = replace(location, "'", "''")
    > sug = replace(sug, "'", "''")
    >
    > sql = "INSERT INTO suggestions VALUES('" & team & "','" & location & "','"
    > &
    > sug & "', NOW())"
    >
    > conn.execute sql, , 129
    >
    > --
    > http://www.aspfaq.com/
    > (Reverse address to reply.)
    >
    >[/ref]


    Jim Guest

Similar Threads

  1. cannot copy or paste
    By brinyside in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: August 22nd, 06:20 AM
  2. can't copy and paste
    By Jean Y in forum Macromedia Contribute General Discussion
    Replies: 1
    Last Post: July 23rd, 03:47 PM
  3. Copy & Paste
    By ploughman1 in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: October 13th, 07:50 AM
  4. Replies: 3
    Last Post: May 13th, 12:15 AM
  5. Copy/Paste to PSP
    By EngMajor webforumsuser@macromedia.com in forum Macromedia Freehand
    Replies: 2
    Last Post: September 19th, 08:00 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •