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:

Recommended Answers

All 4 Replies

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")&"'"

DELETE

sql = "DELETE FROM <table_ name> WHERE <field_name>=<string/variable/no.>";

procedure to connect website to ms access

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.