Hi All,
I'm trying to get the following command (insert into) to
work, but am having
no joy. I would be greatful if you could highlight what i
have done wrong.
Its an for an ASP site using an MS SQL database -
<%
if(Session("BATCHID2") <> "") then
insertaccountinvoice__MMColParam =
Session("BATCHID2")
if(Session("SITEID") <> "") then
insertaccountinvoice__MMColParam2 =
Session("SITEID")
%>
<%
set insertaccountinvoice =
Server.CreateObject("ADODB.Command")
insertaccountinvoice.ActiveConnection = MM_recruta2_STRING
insertaccountinvoice.CommandText = "INSERT INTO
dbo.JBAccountInvoice
(JBACISiteID, JBACIClientID, JBACIAccountType,
JBACIAccountOverwrite,
JBACIBillingContact, JBACIClientName, JBACIClientAddress,
JBACIClientEmail,
JBACIBatchID) VALUES (dbo.JBClient(JBCLSiteID, JBCLID,
JBCLAccountType,
JBCLreguserMonthlyOverwrite, JBCLBillingContact, JBCLName,
JBCLAddress,
JBCLEmail ), " + Replace(insertaccountinvoice__MMColParam,
"'", "''") + "
WHERE JBCLSiteID = '" +
Replace(insertaccountinvoice__MMColParam2, "'", "''")
+ "' and JBCLAccountLive = 'y' and (JBCLAccountType = 'Reg
User' OR
JBCLAccountType = 'Reg User5' OR JBCLAccountType = 'Reg
User10' OR
JBCLAccountType = 'Multi User')) "
insertaccountinvoice.CommandType = 1
insertaccountinvoice.CommandTimeout = 0
insertaccountinvoice.Prepared = true
insertaccountinvoice.Execute()
%>
<% Response.Redirect("
http://www.recruta.co.uk")
%>