954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Connecting ASP to Ms Access

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:

Goitse
Newbie Poster
13 posts since Oct 2006
Reputation Points: 12
Solved Threads: 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")&"'"
millanskie
Junior Poster in Training
63 posts since Dec 2006
Reputation Points: 10
Solved Threads: 1
 

DELETE

sql = "DELETE FROM <table_ name> WHERE <field_name>=<string/variable/no.>";
millanskie
Junior Poster in Training
63 posts since Dec 2006
Reputation Points: 10
Solved Threads: 1
 

procedure to connect website to ms access

marium
Newbie Poster
1 post since Feb 2007
Reputation Points: 10
Solved Threads: 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

Goitse
Newbie Poster
13 posts since Oct 2006
Reputation Points: 12
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You