473,467 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

execute + ArraySearch causes "Expected end of statement" error - Why?

Here is the function ArraySearch:

'--------------------------------------------------------------------------------------
'ArraySearch will return an integer value indicating the first
occurrence of a string
'within an array. for now it only does a case-sensitive
first-occurrence search.
'
'Created by Phil Powell on 6/28/2002
'--------------------------------------------------------------------------------------
Function ArraySearch(myArray, myString)
Dim i
ArraySearch = -1
for i = LBound(myArray) to UBound(myArray)
if strcomp(myArray(i), myString) = 0 and ArraySearch < 0 then
ArraySearch = i
next
End Function
Ok now here is the offending code:

formVarsArray = array("gbID", "firstname", "lastname", "email", "url",
"fave_bands", "gb_entry")

....

if ArraySearch(formVarsArray, key) >= 0 then
execute(key & " = """ & Request.Form(key) & """" & vbcrlf)
if key = "gbID" then gbID = CInt(gbID)
end if

When running this code I get the following error:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/soa/val_cma/gb_listing_edit.asp, line 46

Here is line 46:
execute(key & " = """ & Request.Form(key) & """" & vbcrlf)

I am trying to dynamically set all variables whose names are keys in
the Request.Form collection object to their perspective values, for
example

Request.Form("firstname") = "Phil"
therefore firstname will = "Phil" also

So, basically, what's up? Why is this breaking?

Phil
Jul 19 '05 #1
1 5055
I hate the execute statement. It should be removed. Okay, not really...

Maybe you mean:

execute("response.write key & "" = "" & Request.Form(key) & vbcrlf")

Ray at home

"Phil Powell" <so*****@erols.com> wrote in message
news:1c**************************@posting.google.c om...
Here is the function ArraySearch:

'
When running this code I get the following error:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/soa/val_cma/gb_listing_edit.asp, line 46

Here is line 46:
execute(key & " = """ & Request.Form(key) & """" & vbcrlf)

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code...
2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
3
by: NeilH | last post by:
Hello All I was wondering if someone could offer a rather inexperienced person some advice. Im trying to get my asp page to look at an access data I created the following query in access...
3
by: rdi | last post by:
The import statements weren't copy/pasted, but everything INSIDE the class WAS copy pasted from the help file. Starting with the myMail.From line and going down to the SmtpMail.Send line, EVERY line...
3
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something...
6
by: BaWork | last post by:
I have the following to insert a new record: <% .. Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open "DSN=qqqqq;" SQLStmt = "INSERT INTO tbl_qqqqqq (main_cat, cat_fee, fee_amount)...
3
by: ChildProgrammer | last post by:
I am trying to upload data into an Access db from vb.net. The data was parsed out from text files. Everything seems to be working fine up till the .execute point. The debugger insists there is a...
3
by: DontB3 | last post by:
Hi, I'm new in this forum, and i hope someone can help. I'm creating an automatic application that transfer a database from Access -> DBF -> Oracle. When My App try to execute Insert SQL...
2
by: jman | last post by:
i'm getting an "object expected" error in ie - not ff. in the BODY onload attribute i call a function that's loaded from an external file. i've narrowed the error down to the fact it cannot...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.