<% On Error Resume Next Dim vID, d_Pop, d_RB, d_Date, d_Year, d_Label, d_Artist, d_Song, d_Composer, d_Producer, d_Category, d_ClassPlay Dim d_URL Dim result Dim adoCon Dim rsGuestbook Dim strSQL Set adoCon = Server.CreateObject("ADODB.Connection") adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("..\bm2.mdb"),,0 Set rsGuestbook = Server.CreateObject("ADODB.Recordset") d_Category = Request.QueryString("cat") vID = Request.QueryString("id") If vID="new" Then Response.Write "
---NEW!---
" d_Active = "F" End If If vID<>"" AND Not IsNull(vID) Then strSQL = "SELECT * FROM SongBook WHERE ID1=" & vID result = adoCon.execute(strSQL) ''debug----------- ''Response.Write strSQL If Not result.EOF Then d_Pop = result("Pop") d_RB = result("RB") d_Date = result("ddd") d_Year = result("Year") d_Label = result("Label") d_Artist = result("Artist") d_Song = result("Song") d_Composer = result("Composer") d_Producer = result("Producer") d_Category = result("Category") d_ClassPlay = result("ClassPlay") d_Active = result("Active") d_URL = result("URL") End If End If '''---form posted--- If Request.Form("id")<>"" AND Not IsNull(Request.Form("id")) Then vID = Request.Form("id") d_Pop = Request.Form("d_Pop") d_RB = Request.Form("d_RB") d_Date = Request.Form("d_Date") d_Year = Request.Form("d_Year") d_Label = SQLescape(Request.Form("d_Label")) d_Artist = SQLescape(Request.Form("d_Artist")) d_Song = SQLescape(Request.Form("d_Song")) d_Composer = SQLescape(Request.Form("d_Composer")) d_Producer = SQLescape(Request.Form("d_Producer")) d_Category = SQLescape(Request.Form("d_Category")) d_ClassPlay = Request.Form("d_ClassPlay") d_Active = Request.Form("d_Active") d_URL = SQLescape(Request.Form("d_URL")) If d_Pop="" or IsNull(d_Pop) Then d_Pop = " " End If If d_RB="" or IsNull(d_RB) Then d_RB = " " End If If Request.Form("id")="new" Then strSQL = "INSERT INTO SongBook (Active,Pop,RB,ddd,Year,Label,Artist,Song,COMPOSER,Producer,CATEGORY,ClassPlay,URL) VALUES (" If d_Active = "on" Then strSQL = strSQL & "'T'" Else strSQL = strSQL & "'F'" End If strSQL = strSQL & "," & d_Pop & "" strSQL = strSQL & "," & d_RB & "" strSQL = strSQL & ",'" & d_Date & "'" strSQL = strSQL & ",'" & d_Year & "'" strSQL = strSQL & ",'" & d_Label & "'" strSQL = strSQL & ",'" & d_Artist & "'" strSQL = strSQL & ",'" & d_Song & "'" strSQL = strSQL & ",'" & d_Composer & "'" strSQL = strSQL & ",'" & d_Producer & "'" strSQL = strSQL & ",'" & d_Category & "'" If d_ClassPlay = "on" Then strSQL = strSQL & ",Yes" Else strSQL = strSQL & ",No" End If strSQL = strSQL & ",'" & d_URL & "'" strSQL = strSQL & " ) " adoCon.execute(strSQL) Response.Write "
---Record inserted!---" Else Dim u_Active, u_ClassPlay If d_Active = "on" Then u_Active = "T" Else u_Active = "F" End If If d_ClassPlay = "on" Then u_ClassPlay = "Yes" Else u_ClassPlay = "No" End If strSQL = "UPDATE SongBook Set " strSQL = strSQL & "Active='" & u_Active & "'" strSQL = strSQL & ",Pop=" & d_Pop strSQL = strSQL & ",RB=" & d_RB If d_Date="" or IsNull(d_Date) Then strSQL = strSQL & ",ddd=null" Else strSQL = strSQL & ",ddd='" & d_Date & "'" End If strSQL = strSQL & ",Year='" & d_Year & "'" strSQL = strSQL & ",Label='" & d_Label & "'" strSQL = strSQL & ",Artist='" & d_Artist & "'" strSQL = strSQL & ",Song='" & d_Song & "'" strSQL = strSQL & ",COMPOSER='" & d_Composer & "'" strSQL = strSQL & ",Producer='" & d_Producer & "'" strSQL = strSQL & ",CATEGORY='" & d_Category & "'" strSQL = strSQL & ",ClassPlay='" & u_ClassPlay & "'" strSQL = strSQL & ",URL='" & d_URL & "'" strSQL = strSQL & " WHERE ID1=" & vID adoCon.execute(strSQL) Response.Write "
---Record modified!---" End If ''debug----------- 'Response.Write strSQL If adoCon.errors.count>0 then Response.Write "
" & adoCon.errors.count & " ERRORS OCCURRED!
" Response.Write "
" & Err.description End If End If Response.Write "
" Response.Write "
" %>
Active:<% If d_Active = "T" or d_Active="on" Then Response.Write "" Else Response.Write "" End If %> ClassPlay:<% '''Response.Write "[" & d_ClassPlay & "]
" If d_ClassPlay = "Yes" or d_ClassPlay="on" Then Response.Write "" Else Response.Write "" End If %>
Date:(mm/dd/yyyy) Year:
Pop:
R/B:
Label:
Artist:
Song:
Composer:
Producer:
Category: (ie. 1520, 1570)
URL: <% If d_URL<>"" AND Not IsNull(d_URL) Then Response.Write "    " Response.Write "listen" End If %>