Connecting ASP to Ms Access

Reply

Join Date: Oct 2006
Posts: 13
Reputation: Goitse is an unknown quantity at this point 
Solved Threads: 0
Goitse Goitse is offline Offline
Newbie Poster

Connecting ASP to Ms Access

 
0
  #1
Dec 8th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 63
Reputation: millanskie is an unknown quantity at this point 
Solved Threads: 1
millanskie's Avatar
millanskie millanskie is offline Offline
Junior Poster in Training

Re: Connecting ASP to Ms Access

 
0
  #2
Dec 11th, 2006
try this SAMPLE....

SELECT

  1. <select name="cbo_yrlvl" size="1" class="contlink" id="cbo_yrlvl">
  2. <option>- click to choose year level -</option>
  3. <option selected>N/A</option>
  4.  
  5. <%
  6. set conn=Server.CreateObject("ADODB.Connection")
  7. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  8. conn.Open (Server.Mappath("gok.mdb"))
  9. set rs = Server.CreateObject("ADODB.recordset")
  10. rs.Open "SELECT yrlevel FROM yrandsem WHERE category = 'Short Term Courses'", conn
  11.  
  12. do until rs.EOF
  13.  
  14. for each x in rs.Fields
  15. %>
  16.  
  17. <option><%Response.Write(x.value)%></option>
  18.  
  19. <%
  20. next
  21.  
  22. rs.MoveNext
  23.  
  24. loop
  25.  
  26. rs.close
  27. conn.close
  28.  
  29. %>
  30.  
  31. </select>

INSERT

  1. set conn=Server.CreateObject("ADODB.Connection")
  2. conn.Provider="Microsoft.Jet.OLEDB.4.0"
  3. conn.Open (Server.Mappath("gok.mdb"))
  4.  
  5. sql="INSERT INTO olapplication (name,gender,contactno,emailadd,"
  6. sql=sql & "branch,course,edg) VALUES "
  7. sql=sql & "('"& Request.form("txt_fname") & "',"
  8. sql=sql & "'" & Request.Form("cbo_gender") & "',"
  9. sql=sql & "'" & Request.Form("txt_contactno") & "',"
  10. sql=sql & "'" & Request.Form("txt_emailadd") & "',"
  11. sql=sql & "'" & Request.Form("cbo_branch") & "',"
  12. sql=sql & "'" & Request.Form("cbo_course") & "',"
  13. sql=sql & "'" & Request.Form("cbo_edg") & "')"
  14.  
  15. on error resume next
  16. conn.Execute sql,recaffected
  17.  
  18. conn.close

UPDATE

  1. sql="UPDATE partners SET pname='"&Session("pID")&"',"
  2. sql=sql & "pass='"&Request.form("txt_pass")&"',"
  3. sql=sql & "emailadd='"&Request.Form("txt_emailadd")&"',"
  4. sql=sql & "contactperson='"&Request.Form("txt_contactperson")&"',"
  5. sql=sql & "contactno='"&Request.Form("txt_contactno")&"'"
  6. sql=sql & "WHERE pname='"&Session("pID")&"'"
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 63
Reputation: millanskie is an unknown quantity at this point 
Solved Threads: 1
millanskie's Avatar
millanskie millanskie is offline Offline
Junior Poster in Training

Re: Connecting ASP to Ms Access

 
0
  #3
Dec 11th, 2006
DELETE

  1. sql = "DELETE FROM <table_ name> WHERE <field_name>=<string/variable/no.>";
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1
Reputation: marium is an unknown quantity at this point 
Solved Threads: 0
marium marium is offline Offline
Newbie Poster

Re: Connecting ASP to Ms Access

 
0
  #4
Feb 8th, 2007
procedure to connect website to ms access
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 13
Reputation: Goitse is an unknown quantity at this point 
Solved Threads: 0
Goitse Goitse is offline Offline
Newbie Poster

Re: Connecting ASP to Ms Access

 
0
  #5
Feb 8th, 2007
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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC