Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2007
    Posts
    1

    Unanswered: I Get An Error When Inserting Data in Access

    Dear Brother



    When i submit the data to database i get an internal server error . i am write the following code in my submit.asp file for entering data in database . if u please check this code and remove any error i am very thankful to all of u.





    <%
    dim exhibition , cname ,caddress , ccity , ccountry , cperson , cdesignation , ctelephone , ccellphone , cemail , cfax , cweb , cproduct ,carea ,data_conn,query_sql,rec_exe



    ' getting values from previous form page



    exhibition = Request.form("exhibition")

    cname = Request.form("cname")

    caddress = Request.form("caddress")

    ccity = Request.form("ccity")

    ccountry = Request.form("ccountry")

    cperson = Request.form("cperson")



    cdesignation = Request.form("cdesignation")

    ctelephone = Request.form("ctelephone")

    cmobile = Request.form("cmobile")

    cemail = Request.form("cemail")

    cfax = Request.form("cfax")

    cweb = Request.form("cweb")

    cproduct = Request.form("cproduct")

    carea = Request.form("carea")



    'Creating Data Connection



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

    data_conn.ConnectionString ="DSN=booking"

    data_conn.Open



    'Create Data Entry command



    query_sql="INSERT INTO booking(Exhibition,CompanyName,Address,City,Countr y,ContactPerson,Designation,Telephone,Cell,Email,F ax,Web,Product,Area)



    VALUES('"&request.form("exhibition")&"' , '"&request.form("cname")& "' , '"&request.form("caddress")&"' , '"&request.form("ccity")&"' , '"&request.form("ccountry")&"' , '"&request.form("cperson")&"' , '"&request.form("cdesignation")&"' , "&request.form("ctelephone")&" , "&request.form("cmobile")&" , '"&request.form("cemail")&"' , "&request.form("cfax")&",'"&request.form("cweb")&" ','"&request.form("cproduct")&"','"&request.form(" carea")&"')"

    Set rec_exe=data_conn.execute(query_sql)
    %>

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Something really confuses me here...
    You go to all that trouble of defining variables and assigning values to them, but you don't use them!!

    Anyhow, I think your problem is the connection string. Check out connectionstrings.com for more information on what it should look like.
    George
    Home | Blog

Posting Permissions

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