<% rolle = "" navn = "" persontype = "" aliasnr ="" Set cmd = Server.CreateObject("ADODB.Command") 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") Set RS = Server.CreateObject("ADODB.Recordset") sql = "SELECT TOP 7 film.navn, film.rolle, film.persontype FROM film WHERE (film.navn Is Not Null) AND (film.persontype='a')" ' response.write(sql) RS.Open sql,dbCon2,3,3 do while not RS.eof navn = Replace(RS("navn"), "'", "''") if len(RS("rolle")) > 1 then aliasnr = instr(1, rolle, " (as") if aliasnr > 0 then alias = MID(rolle,aliasnr+5,LEN(rolle)-(aliasnr+5)) rolle = MID(rolle,1,aliasnr-1) end if end if if aliasnr > 0 then sql = "select homeent.person_api.check_exist('"&navn&"') as pcheck, homeent.person_api.check_exist('"&alias&"') as aliascheck from dual" else sql = "select homeent.person_api.check_exist('"&navn&"') as pcheck, homeent.person_api.check_exist('"&navn&"') as aliascheck from dual" end if %> ' response.write(sql & "
") RS2.Open sql,dbCon if RS2("pcheck") = "FALSE" AND RS2("aliascheck") = "FALSE" then With cmd .ActiveConnection = dbcon .CommandText = "HOMEENT.PERSON_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("NAME", adVarChar, adParamInput, 250, RS("navn")) .Parameters.Append param Set param = .CreateParameter("BIRTH_NAME", adVarChar, adParamInput, 50, "") .Parameters.Append param Set param = .CreateParameter("GENDER", adVarChar, adParamInput, 50, "") .Parameters.Append param Set param = .CreateParameter("DAY_OF_BIRTH", adVarChar, adParamInput, 50, "") .Parameters.Append param Set param = .CreateParameter("DAY_OF_DEATH", adVarChar, adParamInput, 50, "") .Parameters.Append param Set param = .CreateParameter("PICTURE", adVarChar, adParamInput, 50, "") .Parameters.Append param Set param = .CreateParameter("COUNTRY_OF_BIRTH", adVarChar, adParamInput, 50, "") .Parameters.Append param End With cmd.Execute end if RS2.close RS.movenext loop RS.close <% sql = "SELECT film.navn, film.rolle, film.persontype FROM film WHERE (film.navn Is Not Null) AND (film.persontype Is Not Null)" ' response.write(sql) RS.Open sql,dbCon2,3,3 do while not RS.eof if aliasnr > 0 then sql = "select homeent.person_api.check_exist('"&navn&"') as pcheck, homeent.person_api.check_exist('"&alias&"') as aliascheck from dual" else sql = "select homeent.person_api.check_exist('"&navn&"') as pcheck, homeent.person_api.check_exist('"&navn&"') as aliascheck from dual " end if ' response.write(sql & "
") RS2.Open sql,dbCon if (RS2("pcheck") = "TRUE") or (RS("persontype") <> "A") OR (RS2("aliascheck") = "TRUE") then With cmd .ActiveConnection = dbcon .CommandText = "HOMEENT.MOVIE_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, 250, "JBN") .Parameters.Append param Set param = .CreateParameter("TITLE", adVarChar, adParamInput, 250, "The Sleeping Dictionary") .Parameters.Append param Set param = .CreateParameter("ORIGINAL_TITLE", adVarChar, adParamInput, 250, "The Sleeping Dictionary") .Parameters.Append param Set param = .CreateParameter("YEAR_OF_PRODUCTION", adVarChar, adParamInput, 250, "2003") .Parameters.Append param if aliasnr > 0 then alias = Replace(alias, "''", "'") Set param = .CreateParameter("PERSON", adVarChar, adParamInput, 250, alias) .Parameters.Append param else Set param = .CreateParameter("PERSON", adVarChar, adParamInput, 250, RS("navn")) .Parameters.Append param end if if RS("persontype") = "A" then persontype = "Actor - Supporting Role" if RS("persontype") = "D" then persontype = "Director" if RS("persontype") = "S" then persontype = "Screenwriter" if RS("persontype") = "P" then persontype = "Producer" if RS("persontype") = "C" then persontype = "Composer" Set param = .CreateParameter("JOB_DESCRIPTION", adVarChar, adParamInput, 250, RS("persontype")) .Parameters.Append param if RS("persontype") = "A" then Set param = .CreateParameter("PLAYING_ROLE", adVarChar, adParamInput, 250, RS("rolle") ) .Parameters.Append param else Set param = .CreateParameter("PLAYING_ROLE", adVarChar, adParamInput, 250, "" ) .Parameters.Append param end if if RS("persontype") <> "A" then Set param = .CreateParameter("AUTO_CREATE_PERSON", adVarChar, adParamInput, 250, "TRUE") .Parameters.Append param else Set param = .CreateParameter("AUTO_CREATE_PERSON", adVarChar, adParamInput, 250, "FALSE") .Parameters.Append param end if End With cmd.Execute end if RS2.close persontype ="" cmd = nothing RS.movenext rolle = "" navn = "" persontype = "" aliasnr ="" loop RS.close cmd = nothing %>