1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

asp with MYSQL

Discussion in 'C#' started by salman.pirani, Aug 23, 2012.

  1. #1
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <%
    set conn=Server.CreateObject("ADODB.Connection")
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open "c:/webdata/northwind.mdb"
    %>

    <%
    sql="INSERT INTO customers (programmetitle,date,"
    sql=sql &"department,supervisorsname,supervisorsemail,supervisorsext,q1a,q1b,q1c,q2,q3,q4,q5,participantsname,employeeid,ext)"
    sql=sql & " VALUES "
    sql=sql & "('" & Request.Form("ptitle") & "',"
    sql=sql & "'" & Request.Form("pdate") & "',"
    sql=sql & "'" & Request.Form("department") & "',"
    sql=sql & "'" & Request.Form("sname") & "',"
    sql=sql & "'" & Request.Form("semail") & "',"
    sql=sql & "'" & Request.Form("sext") & "',"
    sql=sql & "'" & Request.Form("q1a") & "',"
    sql=sql & "'" & Request.Form("q1b") & "',"
    sql=sql & "'" & Request.Form("q1c") & "',"
    sql=sql & "'" & Request.Form("q2") & "',"
    sql=sql & "'" & Request.Form("q3") & "',"
    sql=sql & "'" & Request.Form("q4") & "',"
    sql=sql & "'" & Request.Form("anyc") & "',"
    sql=sql & "'" & Request.Form("pname") & "',"
    sql=sql & "'" & Request.Form("emid") & "',"
    sql=sql & "'" & Request.Form("ext") & "')"


    on error resume next
    conn.Execute sql,recaffected
    if err<>0 then
    Response.Write("No update permissions!")
    else
    Response.Write("<h3>" & recaffected & " record added</h3>")
    end if
    conn.close
    %>
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style type="text/css">
    <!--
    .heading {
    font-size: 24px;
    }
    -->
    </style>
    </head>

    <body>
    <blockquote>&nbsp;</blockquote>
    <form action="post.asp" method="post">
    <table width="938" height="215" border="0" align="center">
    <tr>
    <td colspan="8" class="heading"><p align="center"><strong>The Aga Khan University</strong></p>
    <p>&nbsp;</p>
    <p align="center"><strong>Training Impact Form</strong><strong> </strong></p></td>
    </tr>
    <tr>
    <td colspan="8">&nbsp;</td>
    </tr>
    <tr>
    <td width="228" colspan="2">Programme Title:
    <label></label> </td>
    <td><label>
    <input type="ptitle"/>
    </label></td>
    <td colspan="2">Date:
    <label>
    <input type="pdate"/>
    </label></td>
    <td colspan="2">Department:
    <input type="department"/></td>
    </tr>
    <tr>
    <td colspan="8"><p align="right"><strong></strong></p></td>
    </tr>
    <tr>
    <td colspan="2">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
    <td>Supervisor’s Name: </td>
    <td><input type="sname"/></td>
    <td colspan="2">Supervisor’s Email:
    <input type="semail"/></td>
    <td colspan="2">Supervisor’s Ext:</td>
    <td colspan="2"><input type="sext"/></td>
    </tr>
    <tr>
    <td colspan="6">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8"><p><em>To be filled by Participant’s immediate supervisor (at least) a month after the training to documen</em></p>
    <p><em>t any change in employee's knowledge, skills or attitudes as a result of the training:</em></p></td>
    </tr>
    <tr>
    <td colspan="8">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8"><p>Rate the following questions from 1 to 5:</p></td>
    </tr>
    <tr>
    <td colspan="8">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8"><p><strong>(5-Strongly Agree 90 %, 4 - Agree 80 % , 3 - Somewhat Agree 70%,
    2-Disagree 60% and 1- Strongly Disagree 50%) </strong></p></td>
    </tr>
    <tr>
    <td colspan="8">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3">Q1. Did you see any change as a result of training in employees’ </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3">Knowledge</td>
    <td width="89"><label>
    <input type="radio" name="q1a" value="5"/>
    </label></td>
    <td width="74"><label>
    <input type="radio" name="q1a" value="4"/>
    </label></td>
    <td width="72"><label>
    <input type="radio" name="q1a" value="3"/>
    </label></td>
    <td width="65"><label>
    <input type="radio" name="q1a" value="2"/>
    </label></td>
    <td width="212"><label>
    <input type="radio" name="q1a" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">Skills</td>
    <td><label>
    <input type="radio" name="q1b" value="5"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1b" value="4"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1b" value="3"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1b" value="2"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1b" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">Attitude </td>
    <td><label>
    <input type="radio" name="q1c" value="5"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1c" value="4"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1c" value="3"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1c" value="2"/>
    </label></td>
    <td><label>
    <input type="radio" name="q1c" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3"><p>Q2. Are you satisfied with the employee’s overall performance specific to the training need addressed in the programme?</p></td>
    <td><label>
    <input type="radio" name="q2" value="5"/>
    </label></td>
    <td><label>
    <input type="radio" name="q2" value="4"/>
    </label></td>
    <td><label>
    <input type="radio" name="q2" value="3"/>
    </label></td>
    <td><label>
    <input type="radio" name="q2" value="2"/>
    </label></td>
    <td><label>
    <input type="radio" name="q2" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3"><p>Q3. Did the employee perform differently on the job as a result of this programme?</p></td>
    <td><label>
    <input type="radio" name="q3" value="5"/>
    </label></td>
    <td><label>
    <input type="radio" name="q3" value="4"/>
    </label></td>
    <td><label>
    <input type="radio" name="q3" value="3"/>
    </label></td>
    <td><label>
    <input type="radio" name="q3" value="2"/>
    </label></td>
    <td><label>
    <input type="radio" name="q3" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8"><strong>(5-Strongly Agree 50 %, 4 - Agree 60% , 3-Somewhat Agree 70 %, 2 -Disagree 80 % and 1-Strongly Disagree 90 %) </strong></td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="3">Q4. Does the employee require further training in this area? </td>
    <td><label>
    <input type="radio" name="q4" value="5"/>
    </label></td>
    <td><label>
    <input type="radio" name="q4" value="4"/>
    </label></td>
    <td><label>
    <input type="radio" name="q4" value="3"/>
    </label></td>
    <td><label>
    <input type="radio" name="q4" value="2"/>
    </label></td>
    <td><label>
    <input type="radio" name="q4" value="1"/>
    </label></td>
    </tr>
    <tr>
    <td colspan="3">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8"><blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <blockquote>
    <p>Q5. Any other comments? </p>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote>
    </blockquote></td>
    </tr>
    <tr>
    <td colspan="8"><label>
    <textarea name="anyc" cols="100" rows="20"></textarea>
    </label></td>
    </tr>
    <tr>
    <td colspan="8">&nbsp;</td>
    </tr>
    <tr>
    <td colspan="2">Participant's Name :
    <label>
    <input type="pname"/>
    </label></td>
    <td>Employee ID:
    <label>
    <input type="emid"/>
    </label></td>
    <td>Ext :
    <label>
    <input type="ext"/>
    </label></td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
    <tr>
    <td colspan="8">16</td>
    </tr>
    </table>
    <input name="submit" type="submit" value="Done" />
    <input name="reset" type="reset" />
    </form>
    </body>
    </html>
    i have made some change now its working but not properly kindly let me knw now where am making the mistake

    
    
    
    
    
    HTML:


    asp code
    
    
    
    
    HTML:
    value=
     
    salman.pirani, Aug 23, 2012 IP
  2. salman.pirani

    salman.pirani Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    in which line am making the error because at my hand the head of the columns in server are correct but still it is not working
     
    salman.pirani, Aug 23, 2012 IP
  3. dwirch

    dwirch Well-Known Member

    Messages:
    239
    Likes Received:
    12
    Best Answers:
    1
    Trophy Points:
    135
    #3
    This says you are connecting to an Access database, not MySQL:

    set conn=Server.CreateObject("ADODB.Connection")
     conn.Provider="Microsoft.Jet.OLEDB.4.0"
     conn.Open "c:/webdata/northwind.mdb"
    Code (markup):
    Change your provider and connection string to the proper settings, and go from there.
     
    dwirch, Sep 5, 2012 IP
  4. WeddiGo

    WeddiGo Greenhorn

    Messages:
    40
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    18
    #4
    mySQL connection would be something like this:

    "Driver={MySQL ODBC 3.51 Driver};Server=xxx.xxx.xxx.xxx;Port=3306;Database=your_database_name;User=xxxxxx;Password=xxxxxx;Option=3;"
     
    WeddiGo, Sep 22, 2012 IP