<% on error resume next session.LCID = 1030 Response.Expires =-1 Set dbCon2 = Server.CreateObject("ADODB.Connection") DSN = "Driver={Microsoft Access Driver (*.mdb)};" & "DBQ="&Request.ServerVariables("APPL_PHYSICAL_PATH")&"\data\PersonTest.mdb;" & "DefaultDir="&Request.ServerVariables("APPL_PHYSICAL_PATH")&"\data\;" LOGIN = "" PASS = "" dbCon2.Open DSN Set RS2 = Server.CreateObject("ADODB.Recordset") sql = "SELECT Sheet1.Serienavn, Sheet1.prodaar, Sheet1.epnummer, Sheet1.eptitel, Sheet1.person, Sheet1.rolle FROM Sheet1 WHERE (Sheet1.person) Is Not Null " Set RS = Server.CreateObject("ADODB.Recordset") ' response.write(sql) RS.Open sql,dbCon2,3,3 do while not RS.eof if RS("epnummer") <>"" then epnummer = RS("epnummer") if RS("eptitel") <> "" then eptitel = RS("eptitel") if len(RS("person")) > 1 then personnavn = Replace(RS("person"), "'", "''") end if sql = "select homeent.person_api.check_exist('"&personnavn&"') as pcheck from dual" ' response.write(sql & "
") RS2.Open sql,dbCon aliasnr = instr(1, RS("rolle"), " (as") if aliasnr > 0 then alias = MID(RS("rolle"),aliasnr+5,LEN(RS("rolle"))-(aliasnr+5)) ' response.write(alias & "
") end if if RS2("pcheck") = "TRUE" then rolle = RS("rolle") response.write(RS("person") &" findes i " &epnummer& ". med titlen "&eptitel&" i rollen som "&rolle&")
") Set cmd = Server.CreateObject("ADODB.Command") With cmd .ActiveConnection = dbcon .CommandText = "HOMEENT.SERIES_EP_PEOPLE_New__" .CommandType = adCmdStoredProc Set param = .CreateParameter("info_", adVarChar, adParamOutput, 255, "") .Parameters.Append param Set param = .CreateParameter("objid_", adVarChar, adParamOutput, 20, "") .Parameters.Append param Set param = .CreateParameter("objversion_", adVarChar, adParamOutput, 255, "") .Parameters.Append param Set param = .CreateParameter("action_", adVarChar, adParamInput, 255, "DO") .Parameters.Append param Set param = .CreateParameter("OWNER", adVarChar, adParamInput, 5, "JBN") .Parameters.Append param Set param = .CreateParameter("TITLE", adVarChar, adParamInput, 50, "My So-Called Life") .Parameters.Append param Set param = .CreateParameter("ORIGINAL_TITLE", adVarChar, adParamInput, 50, "My So-Called Life") .Parameters.Append param Set param = .CreateParameter("PRODUCED_FROM", adVarChar, adParamInput, 50, "1994") .Parameters.Append param Set param = .CreateParameter("EPISODE_NUMBER", adVarChar, adParamInput, 50, epnummer ) .Parameters.Append param Set param = .CreateParameter("EPISODE_TITLE", adVarChar, adParamInput, 50, eptitel ) .Parameters.Append param Set param = .CreateParameter("PERSON", adVarChar, adParamInput, 100, personnavn) .Parameters.Append param Set param = .CreateParameter("JOB_DESCRIPTION", adVarChar, adParamInput, 100, "Actor - Series Guest Role") .Parameters.Append param Set param = .CreateParameter("PLAYING_ROLE", adVarChar, adParamInput, 100, rolle) .Parameters.Append param End With cmd.Execute end if RS2.close alias = Replace(alias, "'", "''") sql = "select homeent.person_api.check_exist('"&alias&"') as pcheck from dual" ' response.write(sql & "
") RS2.Open sql,dbCon if RS2("pcheck") = "TRUE" then rolle = MID(RS("rolle"),1,aliasnr-1) response.write(alias &" findes i " &epnummer& ". med titlen "&eptitel&" i rollen som "&rolle&" (som alias))
") Set cmd = Server.CreateObject("ADODB.Command") With cmd .ActiveConnection = dbcon .CommandText = "HOMEENT.SERIES_EP_PEOPLE_New__" .CommandType = adCmdStoredProc Set param = .CreateParameter("info_", adVarChar, adParamOutput, 255, "") .Parameters.Append param Set param = .CreateParameter("objid_", adVarChar, adParamOutput, 20, "") .Parameters.Append param Set param = .CreateParameter("objversion_", adVarChar, adParamOutput, 255, "") .Parameters.Append param Set param = .CreateParameter("action_", adVarChar, adParamInput, 255, "DO") .Parameters.Append param Set param = .CreateParameter("OWNER", adVarChar, adParamInput, 5, "JBN") .Parameters.Append param Set param = .CreateParameter("TITLE", adVarChar, adParamInput, 50, "My So-Called Life") .Parameters.Append param Set param = .CreateParameter("ORIGINAL_TITLE", adVarChar, adParamInput, 50, "My So-Called Life") .Parameters.Append param Set param = .CreateParameter("PRODUCED_FROM", adVarChar, adParamInput, 50, "1994") .Parameters.Append param Set param = .CreateParameter("EPISODE_NUMBER", adVarChar, adParamInput, 50, epnummer ) .Parameters.Append param Set param = .CreateParameter("EPISODE_TITLE", adVarChar, adParamInput, 50, eptitel ) .Parameters.Append param Set param = .CreateParameter("PERSON", adVarChar, adParamInput, 100, alias ) .Parameters.Append param Set param = .CreateParameter("JOB_DESCRIPTION", adVarChar, adParamInput, 100, "Actor - Series Guest Role") .Parameters.Append param Set param = .CreateParameter("PLAYING_ROLE", adVarChar, adParamInput, 100, rolle) .Parameters.Append param End With cmd.Execute end if RS2.close alias = "" aliasnr ="" rolle ="" RS.movenext loop RS.close %>