944,221 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 3639
  • ASP RSS
Dec 8th, 2006
0

Connecting ASP to Ms Access

Expand Post »
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.
Similar Threads
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Goitse is offline Offline
13 posts
since Oct 2006
Dec 11th, 2006
0

Re: Connecting ASP to Ms Access

try this SAMPLE....

SELECT

ASP Syntax (Toggle Plain Text)
  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

ASP Syntax (Toggle Plain Text)
  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

ASP Syntax (Toggle Plain Text)
  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")&"'"
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
millanskie is offline Offline
63 posts
since Dec 2006
Dec 11th, 2006
0

Re: Connecting ASP to Ms Access

DELETE

ASP Syntax (Toggle Plain Text)
  1. sql = "DELETE FROM <table_ name> WHERE <field_name>=<string/variable/no.>";
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
millanskie is offline Offline
63 posts
since Dec 2006
Feb 8th, 2007
0

Re: Connecting ASP to Ms Access

procedure to connect website to ms access
Reputation Points: 10
Solved Threads: 0
Newbie Poster
marium is offline Offline
1 posts
since Feb 2007
Feb 8th, 2007
0

Re: Connecting ASP 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
Reputation Points: 12
Solved Threads: 0
Newbie Poster
Goitse is offline Offline
13 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Code Giving Error
Next Thread in ASP Forum Timeline: verify page not finding random records





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC