asp link Access database

  Connecting to the database, tables, the record operation 

  'Response.Buffer = True 
  'session.codepage = 936 
  'dim rs 

  Set conn = Server.CreateObject ( "ADODB.Connection") 
  DBPath = Server.MapPath ( "Data.mdb") 
  conn.Open "Driver = (Microsoft Access Driver (*. mdb)); DBQ =" & DBPath 
  Set rs = Server.CreateObject ( "ADODB.RecordSet") 
  sql = "select * from table" 
  rs.open sql, conn, 1, 3 
  rs.addnew, add a record rs.edit, amend records rs.delete, delete records 
  rs ( "Field 1") = trim (request.form ( "a control 1")) 
  rs ( "Field 2") = trim (request.form ( "a control 2")) 
…..
rs.update
rs.close
  set conn = nothing 
  set rs = nothing 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • DZone
  • Netvouz
  • NewsVine
  • Technorati

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Tags: , ,