Mulitple insert not working.
I was doing a simple multiple insert but just couldn't get it right. I get this error:
"Microsoft VBScript runtime error '800a01f5'
Illegal assignment: 'WA_AB_checkLoopedFieldsExist'
/warranty3/WA_DataAssist/WA_AppBuilder_VB.asp, line 55
"
I can do a single insert. Below is my simple code. Please assist.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="Connections/warranty3.asp" -->
<%
' WA DataAssist Multiple Inserts
if (cStr(Request.Form("button")) <> "") then
WA_loopedFields = Array("")
WA_connection = MM_warranty3_STRING
WA_table = "Products"
WA_redirectURL = ""
WA_keepQueryString = false
WA_fieldNamesStr = "Airfarecompanypaid"
WA_columnTypesStr = "none,none,NULL"
WA_insertIfNotBlank = ""
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
WA_multipleInsertCounter = 0
while (WA_AB_checkMultiInsertLoopedFieldsExist(WA_loopedFields, WA_multipleInsertCounter))
if (WA_insertIfNotBlank = "" OR WA_AB_checkLoopedFieldsNotBlank(Array(cStr(WA_insertIfNotBlank)), WA_multipleInsertCounter)) then
WA_fieldValuesStr = "textfield"
WA_fieldValues = Split(WA_fieldValuesStr,"|")
insertParamsObj = WA_AB_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = WA_connection
MM_editCmd.CommandText = "INSERT INTO " & WA_table & " (" & insertParamsObj(1) & ") VALUES (" & insertParamsObj(2) & ")"
MM_editCmd.Execute()
MM_editCmd.ActiveConnection.Close()
end if
WA_multipleInsertCounter = WA_multipleInsertCounter + 1
wend
if (WA_redirectURL <> "") then
if (WA_keepQueryString AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
Response.Redirect(WA_redirectURL)
end if
end if
%>
<%
' RepeatSelectionCounter_1 Initialization
Dim RepeatSelectionCounter_1 : RepeatSelectionCounter_1 = 0
Dim RepeatSelectionCounter_1_Iterations : RepeatSelectionCounter_1_Iterations = "3"
Dim RepeatSelectionCounterBasedLooping_1: RepeatSelectionCounterBasedLooping_1 = true
Dim RepeatSelectionCounter_1_IterationsRemaining
If (Not RepeatSelectionCounterBasedLooping_1 AND false) Then
If None__numRows >= 1 Then
If (CInt(None__numRows/RepeatSelectionCounter_1_Iterations) = None__numRows/RepeatSelectionCounter_1_Iterations) Then
None__numRows = CInt(None__numRows/RepeatSelectionCounter_1_Iterations)
Else
None__numRows = CInt(None__numRows/RepeatSelectionCounter_1_Iterations)+1
End If
End If
End IF
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<%
' RepeatSelectionCounter_1 Begin Loop
RepeatSelectionCounter_1_IterationsRemaining = RepeatSelectionCounter_1_Iterations
While(RepeatSelectionCounter_1_IterationsRemaining)
RepeatSelectionCounter_1_IterationsRemaining = RepeatSelectionCounter_1_IterationsRemaining-1
If(RepeatSelectionCounterBasedLooping_1 OR (false AND true) ) Then
%>
<input type="hidden" name="textfield_mihidden_<%=RepeatSelectionCounter_1%>" id="textfield_mihidden_<%=RepeatSelectionCounter_1%>" value="1" />
<input type="text" name="textfield_<%=RepeatSelectionCounter_1%>" id="textfield_<%=RepeatSelectionCounter_1%>" />
<%
' RepeatSelectionCounter_1 Begin Alternate Content
Else
%>
<%
' RepeatSelectionCounter_1 End Alternate Content
End If
If(Not RepeatSelectionCounterBasedLooping_1 AND RepeatSelectionCounter_1_IterationsRemaining <> 0 ) Then
If(false AND true ) Then None.MoveNext
If(false AND CInt(RepeatSelectionCounter_1_Iterations) = -1) THEN RepeatSelectionCounter_1_IterationsRemaining = 0
If(false) Then None__index = None__index+1
End If
RepeatSelectionCounter_1 = RepeatSelectionCounter_1+1
Wend ' RepeatSelectionCounter_1 End Loop
%>
</label>
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Submit" />
</label>
</p>
</form>
</body>
</html>