close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Mulitple insert not working.

Thread began 9/30/2009 11:59 pm by kk_sg390260 | Last modified 3/20/2010 7:51 pm by rmurphy6261468 | 5111 views | 13 replies |

kk_sg390260

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>

Sign in to reply to this post

Eric Mittman

It is difficult to say what may be causing the problem for you without a little more info about the setup and what steps you are taking.

How did you implement the multiple insert? Please review the steps that you have taken to get this into place. If something in the process is not done correctly or is out of order issues can arise so please explain with as much detail as possible the steps you took.

What is the version of DataAssist that you are using for this? This will help if I need to do any testing to check on the result you are getting. This information can be found in the extension manager or by going into the Help > WebAssist > DataAssist > About. At the time of this post the most recent release is 2.0.6.

Sign in to reply to this post

kk_sg390260

Originally Said By: Eric Mittman
  It is difficult to say what may be causing the problem for you without a little more info about the setup and what steps you are taking.

How did you implement the multiple insert? Please review the steps that you have taken to get this into place. If something in the process is not done correctly or is out of order issues can arise so please explain with as much detail as possible the steps you took.

What is the version of DataAssist that you are using for this? This will help if I need to do any testing to check on the result you are getting. This information can be found in the extension manager or by going into the Help > WebAssist > DataAssist > About. At the time of this post the most recent release is 2.0.6.  



I'm using Dataassist 2.06

I'm using MS Access database and Dreamweaver CS4. This is how i implement the multiple insert:

1. I created a VB asp page.
2. Inserted a form with textbox and submit button
3. Created a Dreamweaver recordset
4. Used Dataassist Repeat selection for Textbox Repetitions
5. Run and tested working
6. Next insert Multiple Records,
Trigger: button pressed.
Repeated form: Repeat Selection (2)
Skip if empty: Always insert
Database
Connection: Database6
Table: Table1
After insert
go to (optional): nil.

Configure bindings
Assigned the textbox column (numeric) to the data field (numeric) in the recordsert.

Please kindly assist what could be the issues. Thanks.

Sign in to reply to this post

Eric Mittman

Thanks for the steps. I have done the same as you and get what seems like the same result. I have gone ahead and opened a ticket for you on this so that it can be looked into further. To check the status of the ticket or update it please login to the site and visit your support history.

Sign in to reply to this post

info368164

Hello, I have same problem With DW8 DataAssit 2.06!! (ASP classic pages)

Please, what is the solution?!

Thank you
Luca

Sign in to reply to this post

Eric Mittman

What is the exact text of the error message you are getting? This is very important so that we can determine the best way to proceed.

Sign in to reply to this post

info368164

Exactly the same error:
Microsoft VBScript runtime error '800a01f5'

Illegal assignment: 'WA_AB_checkLoopedFieldsExist'

/crea-serviziorg/WA_DataAssist/WA_AppBuilder_VB.asp, line 51


********* The code of WA_AppBuilder_VB.asp:
44. function WA_AB_checkMultiInsertLoopedFieldsExist(loopedFields, counterVal)
45. dim loopedFieldName
46. loopedFieldName = ""
47. for n=0 to UBound(loopedFields)
48. loopedFieldName = loopedFields(n) & "_mihidden"
49. loopedFieldName = WA_AB_getLoopedFieldName(loopedFieldName, counterVal)
50. if (loopedFieldName <> "" AND (InStr("&" & Request.Form, "&" & loopedFieldName & "=") > 0 OR InStr("&" & Request.QueryString, "&" & loopedFieldName & "=") > 0)) then
51. WA_AB_checkLoopedFieldsExist = true
exit function
********
this is the table row repeated in the form:
<tr>
<td>

<!--THIS INPUT IS MADE BY DATA ASSIST-->
<input type="hidden" name="pazienteidx_mihidden_<%=RepeatSelectionCounter_1%>" id="pazienteidx_mihidden_<%=RepeatSelectionCounter_1%>" value="1" />
<!-- ............. -->

<input type="hidden" name="pazienteidx_<%=RepeatSelectionCounter_1%>" id="pazienteidx_<%=RepeatSelectionCounter_1%>" value="<%=Request.Form("pazienteid")%>" />

<select id="farmacoid_<%=RepeatSelectionCounter_1%>" name="farmacoid_<%=RepeatSelectionCounter_1%>">
....
</select>
</td>
<td>
<input type="text" id="quantita_<%=RepeatSelectionCounter_1%>" name="quantita_<%=RepeatSelectionCounter_1%>" />
</td>
<td>
<input type="text" id="indicazioni_<%=RepeatSelectionCounter_1%>" name="indicazioni_<%=RepeatSelectionCounter_1%>"/>
</td>
</tr>

This is the first time I use the extension with multiple insertions after the upgrade to version 2.06. Before I never had problems.

Thank you
Luca

Sign in to reply to this post

Eric Mittman

Thanks for getting that info back to me. I have opened a ticket for you on this issue. To check the status of your ticket or update it please login to the site and visit your support history.

Sign in to reply to this post

tomr261234

I'm getting same error

Has someone found the solution yet?

Sign in to reply to this post

tomr261234

Temporary fix

Ok - I've identified the source of the problem.

The function defined in the WA_AppBuilder_VB.asp named

WA_AB_checkMultiInsertLoopedFieldsExist

is constructed incorrectly in that it is trying to return a value for the previous function:
WA_AB_checkLoopedFieldsExist

To temporarily fix it, go to the WA_AB_checkMultiInsertLoopedFieldsExist and change the instances of WA_AB_checkLoopedFieldsExist to WA_AB_checkMultiInsertLoopedFieldsExist and it will work correctly.

You may need to replace the copy or mark it in dreamweaver to cloak it so that it doesn't update it on the site.

Hopefully 2.07 will have the fix.

Sign in to reply to this post
loading

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...