1 / 10

ADDING A RECORD

ADDING A RECORD. A) What are we going to do? ADD: 1-datagir.asp 2-dataveritabani.asp B) Design your page C) Create your database a. Access File Name: db341.mdb b. Table Name: member c: Field Names: member( memID , memName, memSurname, memAddress). A). Name:. Surname:. Address:.

Download Presentation

ADDING A RECORD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ADDING A RECORD A) What are we going to do? ADD: 1-datagir.asp 2-dataveritabani.asp B) Design your page C) Create your database a. Access File Name: db341.mdb b. Table Name: member c: Field Names: member(memID, memName, memSurname, memAddress) A) Name: Surname: Address: Submit dataveritabani.asp datagir.asp

  2. ADDING A RECORD B) INSERT / FORM Name Address Sexuality Hobbies Select from a list Which one? PAGE DESIGN IN FRONTPAGE dataveritabani.asp datagir.asp

  3. ADDING A RECORD C) DATABASE DESIGN IN ACCESS Access File Name: db341.mdb

  4. ADDING A RECORD- datagir.asp dataveritabani.asp These lines must be deleted It is better to change according to the related field name of the table

  5. ADDING A RECORD- dataveritabani.asp • Create Connection (bağlantı kur –dbbaglanti.txt) • Process (aspekle.txt) • Close Connection (bağlantı kapat –dbbaglanti.txt) <% set conn341 = Server.CreateObject("ADODB.Connection") conn341.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db341.mdb")) %> ASPEKLE.TXT <% conn341.Close Set conn341 = Nothing %>

  6. It is used to create a database connection Driver  MS Access Database DBQ  Determines File Position Server.MapPath File name must be local and absolute. But it creates some problems. Server.MapPath converts relative address to a absolute address. ADO requires these 2 information ADDING A RECORD- dataveritabani.aspDatabase Connection <% set conn341 = Server.CreateObject("ADODB.Connection") conn341.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db341.mdb")) %>

  7. ADDING A RECORD - dataveritabani.asp Creating a RecordSet – aspekle.txt Set kayitseti = server. CreateObject("ADODB.Recordset") kayitseti.Open "kayit", conn341 , 1 , 3 kayitseti.AddNew kayitseti("kayitTar")=Day(now())& "/" &Month(now())& "/" &Year(now())& " “& FormatDateTime(now(),3) kayitseti("kayitIP")=Request.ServerVariables("REMOTE_ADDR") kayitseti.update kayitseti.close set kayitseti = nothing Response.Write “.........”

  8. ADDING A RECORD - dataveritabani.asp Creating a RecordSet – aspekle.txt rs.open “table_name”, connection_name, Cursor_Type, Lock_Type Open  it enables the recordset ready in order to access data. Cursor Type  it controls the recordset for user operations (Add,Delete,Update) Lock Type  it locks the database record while updating program code. rs.close set rs = nothing Close  it closes open recorset object and depended objects on recordset Nothing  it releases the connection object

  9. ADDING A RECORD - dataveritabani.asp Creating a RecordSet – aspekle.txt Create the connection Create the recordset rs1(“memName”) = request.form(“txtmemName”) rs1(“memSurname”) = request.form(“txtmemSurname”) rs1(“memAddress”) = request.form(“txtmemAddress”) rs1(“memRecordDate”) = Day(now()) & “/ ” & Month(now()) & “/ “ & Year(now()) & “ “ FormatDateTime(now(),3) rs1(“memRecordIP”) = Server.RequestVariables(“REMOTE_ADDR”) Adding a Record Close the Recordset Close the Connection

  10. ADDING A RECORD - dataveritabani.asp

More Related