close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Multiple insert not inserting any records

Thread began 6/25/2010 1:28 pm by kmccoll304905 | Last modified 7/01/2010 9:02 am by kmccoll304905 | 820 views | 2 replies

pinkiguana

Multiple insert not inserting any records

I have spend several hours trying to get the multiple insert in dataassist to work, and it never inserts records, does not even redirect to redirect page, just reloads the insert form. I have followed the video and the pdf that provides instructions.
I have also tested with a regular insert of one record, which does work.

Here is the code. Please tell me if there is something here that is making it fail.


<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="WA_DataAssist/WA_AppBuilder_VB.asp" -->
<!--#include file="Connections/connNFDT.asp" -->
<% Session("TA_SoNo")="12345678"
Session("TA_RideId")=35 %>
<%
Dim rsQuestions__mmSo
rsQuestions__mmSo = "-1"
If (Session("TA_SoNo") <> "") Then
rsQuestions__mmSo = Session("TA_SoNo")
End If
%>
<%
Dim rsQuestions__mmRideId
rsQuestions__mmRideId = "-1"
If (Session("TA_RideId") <> "") Then
rsQuestions__mmRideId = Session("TA_RideId")
End If
%>
<%
Dim rsQuestions
Dim rsQuestions_cmd
Dim rsQuestions_numRows

Set rsQuestions_cmd = Server.CreateObject ("ADODB.Command")
rsQuestions_cmd.ActiveConnection = MM_connNFDT_STRING
rsQuestions_cmd.CommandText = "SELECT TA_QId, TA_Question, TA_BusMetricDescript, TA_RideId, TA_SO, TA_BusMetricName FROM dbo.View_GetQuestions WHERE TA_SO=? AND TA_RideId=?"
rsQuestions_cmd.Prepared = true
rsQuestions_cmd.Parameters.Append rsQuestions_cmd.CreateParameter("param1", 200, 1, 255, rsQuestions__mmSo) ' adVarChar
rsQuestions_cmd.Parameters.Append rsQuestions_cmd.CreateParameter("param2", 5, 1, -1, rsQuestions__mmRideId) ' adDouble

Set rsQuestions = rsQuestions_cmd.Execute
rsQuestions_numRows = 0
%>
<%
' WA DataAssist Multiple Inserts
if (cStr(Request.Form("btnSubmit")) <> "") then
WA_loopedFields = Array("hRideId", "hSO", "hQId")
WA_connection = MM_connNFDT_STRING
WA_table = "dbo.TA_EvalDetails"
WA_redirectURL = "success.asp"
WA_keepQueryString = true
WA_fieldNamesStr = "TA_RideId|TA_SO|TA_QId"
WA_columnTypesStr = "none,none,NULL|',none,''|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 = "" & cStr(WA_AB_getLoopedFieldValue("hRideId", WA_multipleInsertCounter)) & "" & "|" & "" & cStr(WA_AB_getLoopedFieldValue("hSO", WA_multipleInsertCounter)) & "" & "|" & "" & cStr(WA_AB_getLoopedFieldValue("hQId", WA_multipleInsertCounter)) & ""
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 = "25"
Dim RepeatSelectionCounterBasedLooping_1: RepeatSelectionCounterBasedLooping_1 = false
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 name="frmBehaviors">
<p>Question Selection*for Service Order {Session.TA_SoNo} </p>
<%
' 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 (Not rsQuestions.EOF AND true) ) Then
%>
<table width="80%" border="1">
<tr>
<td width="30%"><input type="hidden" name="hRideId_mihidden_<%=RepeatSelectionCounter_1%>" id="hRideId_mihidden_<%=RepeatSelectionCounter_1%>" value="1" />
<input name="hQId_<%=RepeatSelectionCounter_1%>" type="hidden" id="hQId_<%=RepeatSelectionCounter_1%>" value="<%=(rsQuestions.Fields.Item("TA_QId").Value)%>" />
<input name="hRideId_<%=RepeatSelectionCounter_1%>" type="hidden" id="hRideId_<%=RepeatSelectionCounter_1%>" value="<%=(rsQuestions.Fields.Item("TA_RideId").Value)%>" />
<input name="hSO_<%=RepeatSelectionCounter_1%>" type="hidden" id="hSO_<%=RepeatSelectionCounter_1%>" value="<%=(rsQuestions.Fields.Item("TA_SO").Value)%>" />
<%=(rsQuestions.Fields.Item("TA_SO").Value)%> -<%=(rsQuestions.Fields.Item("TA_RideId").Value)%></td>
<td width="70%"><p><%=(rsQuestions.Fields.Item("TA_Question").Value)%></p></td>
</tr>
</table>
<%
' RepeatSelectionCounter_1 Begin Alternate Content
Else
%>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<%
' RepeatSelectionCounter_1 End Alternate Content
End If
If(Not RepeatSelectionCounterBasedLooping_1 AND RepeatSelectionCounter_1_IterationsRemaining <> 0 ) Then
If(Not rsQuestions.EOF AND true ) Then rsQuestions.MoveNext
If(rsQuestions.EOF 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
%>
<table width="80%">
<tr>
<td align="center"><label>
<input type="submit" name="btnSubmit" id="btnSubmit" value="Begin Service Evaluation" />
</label></td>
</tr>
</table>
<p>&nbsp;</p>
</form>
</body>
</html>
<%
rsQuestions.Close()
Set rsQuestions = Nothing
%>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...