0

I am developing a system that has to connect the website to the database. I have started designing the site and I need to connect it to the database and have options of creating new members, updating new records and deleting some records.

If anyone has some solutions to the problem, please respond.
:confused:

3
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by Goitse
0

try this SAMPLE....

SELECT

<select name="cbo_yrlvl" size="1" class="contlink" id="cbo_yrlvl">
      <option>- click to choose year level -</option>
      <option selected>N/A</option>
 
      <%
            set conn=Server.CreateObject("ADODB.Connection")
            conn.Provider="Microsoft.Jet.OLEDB.4.0"
            conn.Open (Server.Mappath("gok.mdb"))
            set rs = Server.CreateObject("ADODB.recordset")
            rs.Open "SELECT yrlevel FROM yrandsem WHERE category = 'Short Term Courses'", conn
 
            do until rs.EOF
 
                for each x in rs.Fields
       %>
 
                    <option><%Response.Write(x.value)%></option>
 
       <%
                next
 
                rs.MoveNext
 
            loop
 
            rs.close
            conn.close
 
         %>
 
</select>

INSERT

set conn=Server.CreateObject("ADODB.Connection")
     conn.Provider="Microsoft.Jet.OLEDB.4.0"
     conn.Open (Server.Mappath("gok.mdb"))
 
     sql="INSERT INTO olapplication (name,gender,contactno,emailadd,"
                sql=sql & "branch,course,edg) VALUES "
                sql=sql & "('"& Request.form("txt_fname") & "',"
         sql=sql & "'" & Request.Form("cbo_gender") & "',"
         sql=sql & "'" & Request.Form("txt_contactno") & "',"
         sql=sql & "'" & Request.Form("txt_emailadd") & "',"
         sql=sql & "'" & Request.Form("cbo_branch") & "',"
         sql=sql & "'" & Request.Form("cbo_course") & "',"
         sql=sql & "'" & Request.Form("cbo_edg") & "')"
 
     on error resume next
     conn.Execute sql,recaffected
 
     conn.close

UPDATE

sql="UPDATE partners SET pname='"&Session("pID")&"',"
         sql=sql & "pass='"&Request.form("txt_pass")&"',"
         sql=sql & "emailadd='"&Request.Form("txt_emailadd")&"',"
         sql=sql & "contactperson='"&Request.Form("txt_contactperson")&"',"
         sql=sql & "contactno='"&Request.Form("txt_contactno")&"'"
         sql=sql & "WHERE pname='"&Session("pID")&"'"
0

I have a procedure that I sended last week with a thread about - "code giving error".

I hope you can find it and respond.

Thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.