 				<br>thisPermitAgentRole: #thisPermitAgentRole#
 				<cfif left(thisPermitAgentId,3) is "new" and len(thisPermitAgent) gt 0 and len(thisPermitAgentRole) gt 0>
 					<br>
-
-					insert into permit_agent (
-						permit_id,
-						agent_id,
-						agent_role
-					) values (
-						#permit_id#,
-						#thisPermitAgent#,
-						'#thisPermitAgentRole#'
-					)
+					<cfquery name="ipag" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+						insert into permit_agent (
+							permit_id,
+							agent_id,
+							agent_role
+						) values (
+							#permit_id#,
+							#thisPermitAgent#,
+							'#thisPermitAgentRole#'
+						)
+					</cfquery>
 				<cfelseif left(thisPermitAgentId,3) is not "new">
 					<cfif thisPermitAgentRole is "DELETE">
-						<br>delete from permit_agent where permit_agent_id=#thisPermitAgentId#
+						<cfquery name="dpag" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+							delete from permit_agent where permit_agent_id=#thisPermitAgentId#
+						</cfquery>
 					<cfelse>
-						<br>update permit_agent set agent_id=#thisPermitAgent#,agent_role='#thisPermitAgentRole#' where  permit_agent_id=#thisPermitAgentId#
+						<cfquery name="dpag" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
+							update permit_agent set agent_id=#thisPermitAgent#,agent_role='#thisPermitAgentRole#' where  permit_agent_id=#thisPermitAgentId#
+						</cfquery>
 					</cfif>
 
 				</cfif>


		</CFLOOP>
	</cftransaction>
	<!----
		<cfloop query="permitType">
						<tr>





---->
</cfoutput>
