This code, I am using to add project details into a DB, the only thing is, is that it aint getting written to the DB!,..could anyone please assist?
Richard Noon
Code:
<!--#include file="security.asp" -->
<%
'File: PrivatePageProject.asp
'Description: Authorised Page
'set conn=Server.CreateObject("ADODB.Connection")
'conn.Provider="Microsoft.Jet.OLEDB.4.0"
'conn.Open "D:/Websites/richard/admin/db/users.mdb"
for xx=1 to Request("ProjectStart").Count
for y=1 to Request("ProjectFinish").Count
for z=1 to Request("OrganisationName").Count
for jb=1 to Request("ProjectRole").Count
for jd=1 to Request("ProjectDetails").Count
if xx=y Then
if xx=z Then
if xx=jb Then
if xx=jd Then
'Response.Write Request("ProjectStart").Item(xx) & Request("ProjectFinish").Item(y) & Request("OrganisationName").Item(z) & Request("ProjectRole").Item(z) & Request("ProjectDetails").Item(z) & "<br />"
'Response.Write(strUserName)
strSQL = "INSERT into tblProject (ProjectStart, ProjectFinish, OrganisationName, ProjectRole, ProjectDetail, UserName) values ('" & Request("ProjectStart").Item(xx) & "', '" & Request("ProjectFinish").Item(y) & "', '" & Request("OrganisationName").Item(z) & "', '" & Request("ProjectRole").Item(z) & "', '" & Request("ProjectDetails").Item(z) & "', '" & strUserName & "') "
'Response.Write(strSQL)
conn.Execute strSQL
End If
End If
End If
End If
'response.write("ProjectStart #" &xx& " is " & Request("ProjectStart").Item(xx) & "<br />")
'response.write("ProjectFinish #" &y& " is " & Request("ProjectFinish").Item(y) & "<br />")
next
next
next
next
next
'Response.Write("Database has been updated")
'Response.Write(strSQL)
'conn.close
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "D:/Websites/richard/admin/db/users.mdb"
'Build connection
'strSQL="insert into tblUsers ([UserID], First_Name, Last_Name, [Password], Sec_ques, Ethnicity, Sec_Ans, Birth_Year, Address, Post_Code, e_mail, www, Gender, County, Country, Nationality, Required, OtherPermit, DistributionLogistics, ManOps, StratDev, AccountCon, CorpFin, ITDeploy, ITDesign, ITOther, Marketing, HumanResources, Sales, Purchasing, Automotive, ECommerce, Energy, FinServices, ITIndustry, LeisureIndustry, HealthIndustry, ManufacturingEngineering, NotForProfit, Publishing, Retail, TeleComs, TransportationIndustry, UtilityIndustry, Other) values ('" & UserID& "', '" & First_Name& "', '" & Last_Name& "', '" & Password& "' , '" & Sec_ques& "', '" & Sec_Ans& "', '" & Birth_Year& "', '" & Address& "', '" & Post_Code& "', '" & e_mail& "', '" & www& "', '" & Gender& "', '" &County & "', '" &Country & "', '" &Nationality & "','" &Required & "','" & OtherPermit& "','" & DistributionLogistics& "','" & ManOps& "','" & StratDev& "','" & AccountCon& "','" & CorpFin& "','" & ITDeploy& "','" & ITDesign& "','" &'ITOther& "','" & Marketing& "','" & HumanResources& "','" & Sales& "','" & Purchasing& "','" & Automotive& "','" & ECommerce& "','" & Energy& "','" & FinServices& "','" & ITIndustry& "','" & LeisureIndustry& "','" & HealthIndustry& "','" & ManufacturingEngineering& "','" & NotForProfit& "','" & Publishing& "','" & Retail& "','" & TeleComs& "','" & TransportationIndustry& "','" & UtilityIndustry& "','" & Ethnicity& "','" & Other& "');"
response.write(strSQL)
'conn.Execute strSQL
'conn.Execute sql,recaffected
conn.close
%>
Richard Noon