% dim actiondo,firstname,lastname,company,dbcon,recset,typeInput,email,address,tel,fax,mobile,birthday,country dim title,comment,lastID,numdb actiondo=request.form("actiondo") title=request.form("title") firstname=request.form("firstname") lastname=request.form("lastname") company=request.form("company") address=request.form("address") tel=request.form("tel") fax=request.form("fax") email=request.form("email") mobile=request.form("mobile") country=request.form("country") birthday=request.form("birthday") comment=request.form("comment") typeInput=request.form("typeInput") numdb=cint(request.form("numdb")) if (lcase(actiondo)="submit") then set dbcon=server.createobject("ADODB.Connection") set recset=server.createobject("ADODB.Recordset") 'response.write connectionstring dbcon.open connectionstring if lcase(typeinput)="agent" then recset.open "select agentID from agentProfile order by agentID",dbcon,1,3 if (recset.recordcount=0) then lastID=0 else recset.movelast lastID=recset("agentID") end if recset.close recset.open "agentProfile",dbcon,1,3 i=1 for i=1 to numdb if (lcase(trim(request.form("db" & i)))="on") then recset.addnew recset("agentID")=lastID+1 recset("title")=title recset("firstname")=firstname recset("lastname")=lastname recset("company")=company recset("address")=address recset("tel")=tel recset("fax")=fax recset("email")=email recset("mobile")=mobile recset("birthday")=birthday recset("country")=country recset("comment")=comment recset("ofHotelID")=i recset.update lastID=lastID+1 end if next recset.close elseif lcase(typeinput)="customer" then recset.open "select customerID from customerProfile order by customerID",dbcon,1,3 if (recset.recordcount=0) then lastID=0 else recset.movelast lastID=recset("customerID") end if recset.close recset.open "customerProfile",dbcon,1,3 i=1 for i=1 to numdb if (lcase(trim(request.form("db" & i)))="on") then recset.addnew recset("customerID")=lastID+1 recset("title")=title recset("firstname")=firstname recset("lastname")=lastname recset("company")=company recset("address")=address recset("tel")=tel recset("fax")=fax recset("email")=email recset("mobile")=mobile recset("birthday")=birthday recset("country")=country recset("comment")=comment recset("ofHotelID")=i recset.update lastID=lastID+1 end if next recset.close else response.write "Please select type of data.." response.end end if dbcon.close set dbcon=nothing %>
<% end if %>