473,769 Members | 6,799 Online
Bytes | Software Development & Data Engineering Community
+ 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(myA rray, 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(for mVarsArray, key) >= 0 then
execute(key & " = """ & Request.Form(ke y) & """" & 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(ke y) & """" & 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("f irstname") = "Phil"
therefore firstname will = "Phil" also

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

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

Maybe you mean:

execute("respon se.write key & "" = "" & Request.Form(ke y) & vbcrlf")

Ray at home

"Phil Powell" <so*****@erols. com> wrote in message
news:1c******** *************** ***@posting.goo gle.com...
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(ke y) & """" & vbcrlf)

Jul 19 '05 #2

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

Similar topics

5
2724
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 below is for the up and down buttons along with a reset button (which reloads the list as it was originally) and a change button which applies the changes. In Explorer and Safari for Mac, this code works flawlessly. When I tested on Explorer in...
2
9801
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 in a link. that function can have parameters for URL and window name passed to it. This works peachy in Firefox (1.0). With IE 6 (6.0.29) on two separate computers, I get an "onject expected" error. Going to the MS-based debugger just tells me...
3
5587
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 and it worked running it in access. However when i paste it into the asp page i get an "Expected end of
3
2270
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 results in a "Declaration Expected" error. -- RDI (remove the exclamation from the email address) Imports System.Web Imports System.Web.Mail
3
3193
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 missing from the code? Thanks - Jon Private Sub MakeParentTable() ' Create a new DataTable. Dim myDataTable As Datatable = New Datatable("ParentTable")
6
2100
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) " SQLStmt = SQLStmt & "VALUES ('" & main_cat & "','" & cat_fee & "','" & fee_amount & "')"
3
2616
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 syntax error in my statement, but when I check my insert into statement, I get what I expect. What am I doing wrong? Here is my code.: Dim str As String Dim s As ADODB.Connection = New ADODB.Connection Dim cmd As OleDbCommand s.ConnectionString =...
3
3896
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 statement from DBF to Oracle database i found an error like this {Run-time error "7": Error executing statement! Error: System resource exceeded.} and then my program crash! i have to close my app, and start again. could some one help me to...
2
2469
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 find this function. <script src="external.js">
0
9424
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10051
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8879
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
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 we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.