SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2009
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access database error

    Hi

    If you go here fill out the form it will take you to the following page with this error:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
    [Microsoft][ODBC Microsoft Access Driver] The INSERT INTO statement contains the following unknown field name: 'name'. Make sure you have typed the name correctly, and try the operation again.
    /kpmg/4.1.asp, line 156

    This is the script I am using

    Code:
    src = Server.Mappath("folder\mydatabase.mdb")
        sConnStr = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & src 
        Set OBJdbConn = Server.CreateObject("ADODB.Connection")
        OBJdbConn.Open sConnStr
        Set RsPriceList = Server.CreateObject("ADODB.recordset")
        RsPriceList.Open "INSERT INTO info (name,company,job,email,inquiry) VALUES ('"& Replace(Session("name"), "'", "") &"','"& Replace(Session("company"), "'", "") &"','"& Replace(Session("job"), "'", "") &"','"& Replace(Session("email"), "'", "") &"','"& Replace(Session("query"), "'", "") &"');", OBJdbConn
    
    RsPriceList.Close
        Set RsPriceList = Nothing
        OBJdbConn.Close
        Set OBJdbConn = Nothing

    I read online somewhere that it coud be to do with the read write permissions on the database folder, I have checked with the hosting company and they have told me that it does have read writ permissions.

    Any ideas where I am going wrong please?


    Thanks

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I suspect "name" is a reserved word and is causing problems for Access or the field "name" physically does not exist in the database.

  3. #3
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,077
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by webber123456 View Post
    I suspect "name" is a reserved word and is causing problems for Access or the field "name" physically does not exist in the database.
    It is. Found this via a quick Google search: http://support.microsoft.com/kb/286335

    In MySQL reserved words can be used when enclosed with ` but I don't know if the same holds true for Access
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  4. #4
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For Access/ASP enclose the field name in square brackets [ ]


    RsPriceList.Open "INSERT INTO info (
    [name],company, ...
    Ian Anderson
    www.siteguru.co.uk


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
  •