Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







Select Case Syntax Error


I'm getting a syntax error with a Select Case statement:

Select Case CSng(rs.fields("Field1"))
Case 0
Response.Write "Test1"
Case Is < 0 <<< Syntax Error
Response.Write "Test2"
Case Is > 0 <<< Syntax Error
Response.Write "Test3"
End Select

As far as I can tell the syntax *is* correct. What am I missing?


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Select Case Error
Using keyword "To" in select case giving error.The following code is got from www.microsrosoft.com itself. What is the wrong with this?.

<%
Dim Number1
Number1 = 7 ' Initialize variable.
Select Case Number1 ' Evaluate Number1.
Case 1 To 5 ' Number1 between 1 and 5, inclusive.
Response.Write( "Between 1 and 5" )
' The following is the only Case clause that evaluates to True.
Case 6, 7, 8 ' Number1 between 6 and 8.
Response.Write( "Between 6 and 8")
Case 9 To 10 ' Number1 is 9 or 10.
Response.Write( "Greater than 8")
Case Else ' Other values.
Response.Write( "Not between 1 and 10")
End Select
%>

View Replies !   View Related
Dim Inside Select Case Executes In Any Case?
Code like this
=======================
Select case q
Case "a"
Dim arr(5)
Case "b"
Dim arr(2)
end select
=====================
returns an error saying variable arr redefined.
Should it be like that or an I using Select incorrectly? Perhaps something
similar to break needs to be used?

View Replies !   View Related
Case Include... Syntax
I'm trying to put together that standard case include method of building websites in ASP. The variable for the ASP switch comes from a query string.

<%
Select Case Request.QueryString("page")
case "home"
<!--#include file = "content/home.inc"-->
end select
%>

It isn't working, though... do you guys spot a syntax error or something??

View Replies !   View Related
How To Use Select Case
I was trying to colorize my Events from my eventtable.
Past = Grey
Today = Yellow
Future = Blue

Now my question:

How can i specify a statement not when its EQUAL to a number but greater or less than zero for example

I tried this thing and some else but it didn't really work...

color="#6464ce"
Case Else
color="black"
End Select

Probably its a simple solution and don't see the forest because there are so many trees

View Replies !   View Related
SELECT CASE In ASP?
I am having a hard time understanding how to use a SELECT CASE in ASP. I
have used it in VB but never in ASP scripting.

Scenerio:

I have 2 textboxes on a form that I have to allow entry to one or the other
or Both at the same time. Now I tried to use an If ElseIf but it got too
hard to track, so now I am using a SELECT CASE Statement.

TEXBOX1 named strEnglish
TEXBOX2 named strFrench

My code:
<%
strEnglish=Request.Form("strEnglish")
strFrench=Request.Form("strFrench")

Select Case

Then I have no idea how to go from here, because I have 2 input textboxes to
follow. Code:

View Replies !   View Related
Select Case Between Value
"Stock Value" Could be anything from 0 to a million or so, and might include a decimal (12345.67) . I can't find how to do this:

Select Case StockValue
Case 0 To 30000
response.Write("Less than 30000")
Case 30000 To 80000
response.Write("30000 to 80000")
Case 80000 To 180000
response.Write("80000 to 180000")
Case Else ' > 180000
response.Write("Greater than 180000")
End Select

I also tried Case > 0 And <30000 .... and so on

how to write this select script please?

View Replies !   View Related
Select Case Alternative
I would like to know if there is alterntiave to using Select Case?I have over 80 files that a user can select from a drop down list and 'read'. Rather than writing out 80+ lines with INC files, what is the other less code option?

View Replies !   View Related
Select Case Statement
Code:

Function SetAvgClass(val)
If NOT isnull(val) Then
Select Case cint(val)
Case (val < 100)
SetAvgClass = "belowexpected"
Case (val > 100)
SetAvgClass = "aboveexpected"
Case 100
SetAvgClass = "expected"
End Select
Else
SetAvgClass = "belowexpected"
End If
End Function

The only case that seems to be working correctly is thw case 100. am i using incorrect syntax for the > and < statements?

View Replies !   View Related
Select Case Variable
I have an array made using split to create act_count variable below I am then using a select case to write names from array.. Code:

View Replies !   View Related
Select Case Compare
I'm doing a form validation function in ASP. I have a password and a passwordVerify field that must be the same value. In a Select Case, how can I compare the two values?

Case "password"
If Len(sFieldValue) <4 or Len(sFieldValue) >20 Then bFieldIsOkay = False
Case "passwordVerify"
If sFieldValue <> (someway to compare password) Then bFieldIsOkay = False
...

View Replies !   View Related
Select Case And Combine Two Numbers
i have two numbers that i need to combine and then depending on the result i need to write different instructions to the browser. Code:

View Replies !   View Related
Embed A SELECT CASE Statement In An IF Statment
i have a select case statement that checks for a couple of options e.g.

<%select case aParameters(0)
case 0 %>

.. some code

<%case 2 %>

however i would like to test for a certain condition within the select cases statment. To see if a session variable exists before implementing some code:

View Replies !   View Related
SQL Select Syntax
I have a sql query as follows...

Set rs = conn.execute("Select * from Table Where Name Like '%" &String1& "%' AND Name Like '%" &String2& "%' AND Name NOT LIKE '%" &String3& "%' OR Name NOT LIKE '%" &String4& "%' Or Name NOT LIKE '%" &String5& "%' ")

I want to group the qualifiers kinda like this example but I don't know the syntax to do it...

Set rs = conn.execute("Select * from Table Where (Name Like '%" &String1& "%' AND Name Like '%" &String2& "%') AND (Name NOT LIKE '%" &String3& "%' OR Name NOT LIKE '%" &String4& "%' Or Name NOT LIKE '%" &String5& "%') ")

You can see how I want to group the qualifiers. What would be the syantax for doing this?

View Replies !   View Related
SELECT Syntax In MySQL
Could anybody tell how this query statement looks like in MySQL syntax?

SELECT (Left(TAB1.Field1,InStr(TAB1.Field1,"-")-1)

I have a field containing Styles such as 1010-10, 1010-20, 5050-40, LS7856-10, 7856, 9090. I need select and group them by the part which is before "-". In Access it was pretty easy but in MySQL syntax error appears.

View Replies !   View Related
Select From Two Tables Syntax
After selecting from two table like so-

select table1.column, table2.column from table1, table2 ...

What is the correct syntax to access the individual table data? With one table I would normally just use- rs("column").

View Replies !   View Related
Microsoft VBScript Compilation Error '800a03ea' Syntax Error
I am trying to display data from three tables in an MS Access database. Here is my code:

View Replies !   View Related
Error :: Syntax Error (missing Operator) In Query Expression
I am working on a project using an access db. Here is the problem.

Error
Code:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing
operator) in query expression 'unit=6400s'
Unit is what it is suppose to be, I don't understand why I am getting this error? Here's the code for this part.

Code:
sql="SELECT * FROM " & tableStr & " WHERE Model=" & unitStr

tableStr and unitStr are variables. Table and unit are passed into the page and are assigned to the two variables through a request.querystring().

View Replies !   View Related
SQL Error (0x80040E14) Syntax Error Missing Operator
This is the sql statement:

sqlquery="SELECT * FROM tblrequest WHERE Req_id= " & Req_id & " "
set rs=con.execute (sqlquery)

Req_id is coming from a form like so:

Req_id=request.form("Req_id")

The error is:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Req_id='.

On the first line of the query.

See anything wrong that would cause this error?

Please help, the Req_id is being sent from previous form via a hidden value hope i'm requesting this properly.

View Replies !   View Related
Error '80040e14' Syntax Error In INSERT INTO Statement
I'm having a very difficult time with an ASP page that I develpoped in Dreamweaver and the MS Access DB it's supposed to update. When I submit the data the following error appears:

Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/sessiondata2.asp, line 115

I know this is usually a reserved word issue but I don't think that's the case here because the page updates perfectly when executed on my computer as a testing server.

The rest of the site updates data into the database properly so I know the connection string is working. I can't figure out what would throw an error on a live server when there isn't one on a testing server. Code:

View Replies !   View Related
Upper Case And Lower Case
I need to filter the records of a table where the records contain a searchin string with no case sensitive compare, and all with one only sql statement.

"SELECT * FROM Stuff WHERE LOWER(StuffName) LIKE '%" & lcase(StrSearch) & "%'"

but the error is in the function LOWER exist a similar function ?

View Replies !   View Related
Error: Syntax Error In FROM Clause
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
----------------------------------------------------------------------------------

Yes, I know this question has been answered a million times, however, I've already searched through this forum and my problem still hasn't been resolved.

Basically, I keep getting the error above whenever I try to execute this code. This code is from a search page entitled search.asp.

Here's my code:

View Replies !   View Related
Error :: Syntax Error From Clause
What does this error means? 'Syntax Error From Clause'.

View Replies !   View Related
Error :: [Microsoft][ODBC Microsoft Access Driver] Syntax Error In INSERT INTO Statement
I have this insert statement where instruction field in the DB is a memo field.

SQL="INSERT INTO int ([instruction]) VALUES " & _
"('"&Request.Form("myTextarea")&"')"

objConn.Execute(SQL)


Its giving me error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.

View Replies !   View Related
Syntax Error
I'm using an Access database file for this. I can issue SELECT statements on the database, but for some reason it says I have a syntax error with my UPDATE statement.
Code:

openAccessRS("UPDATE students SET password='test' WHERE sid='123456789' AND email='google@yahoo.com'")

Don't worry about the openAccessRS function. It just takes the query and issues the ADO.RecordSet.Open function. I have the students table filled with the correct information. I do have an entry where the student id (sid) is 123456789 and email = google@yahoo.com.This query worked fine in a MySQL DB.

View Replies !   View Related
Syntax Error
Microsoft JET Database Engineerror '80040e07'Syntax error in date in query expression 'fldUserName= 'muratsa' AND fldTimeIn=#01.09.2003 16:52:20# AND fldOffline=0'. /Vestelweb/logout.asp, line 7

I am using the Now() function to get the date
in db the format is general date and in regional settings of the server the seperator is "."

View Replies !   View Related
SQL Syntax Error
Could anyone tell me what is wrong with this SQL statement:

sqlInsertShow = "INSERT INTO tblShowings (date) VALUES (#12/12/2004#)"

Im trying to inder this into an MS Access database, and the field name DATE, is set to date/time value.The error message I get is:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
/fyp/backend/add_show_03.asp, line 41

Ive been scratching my head over this for AGES now! It just will not work.

View Replies !   View Related
Syntax Error
What does the error mean???

Dim rs_sbu
Dim rs_sbu_numRows
Set rs_sbu = Server.CreateObject("ADODB.Recordset")
rs_sbu.ActiveConnection = MM_dsprms_STRING
rs_sbu.Source = "select count(BUID) from SBU where BUID=" & buid & " and SBU='none';"
rs_sbu.CursorType = 0
rs_sbu.CursorLocation = 2
rs_sbu.LockType = 1
rs_sbu.Open()
rs_sbu_numRows = 0

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

View Replies !   View Related
Syntax Error
I am trying to update an Access database using an ASP form with a date. All
I return is a custom error telling me there is a syntax error with the field

View Replies !   View Related
Syntax Error
i get the following error when i execute this update statement
cmd.commandText = "Update Login set Password = '" & pwd & "' , DateofCreation = '" & creationdate & "' , Active = " & active & " where Username = '" & uname & "'"
cmd.execute ---------> line 25
pwd= "secret"
creationdate = "21/12/2004"
uname = "test"
active = false (datatype = yes/no format = true/false)
i am using access database
i have gone through this statement many time but couldnot find the error.

Microsoft JET Database Engine (0x80040E14)
Syntax error in UPDATE statement.
/portfoliomgmt/saveedituser.asp, line 25

View Replies !   View Related
Syntax Error
I have a page on my site in which i wish to display links to brochures, and
i have stored an index of these links in my database.
however when i pass from the master page,
http://www.tripakltd.com/brochures.asp to the detail page, by selecting a
item from the list/menu and submitting, i cannot seem to be able to carry a
variable as a value, i.e i am submitting CategoryID as a variable so i want
it to equal % but i only seem to be able to get it to work if a specify a
figure, such as number 1, and then that isnt very useful because for every
product i select on the drop down list/menu i'll only receive the brochures
associated with number 1.

View Replies !   View Related
SQL Syntax Error
I have:

fourthSQL = "SELECT * FROM volunteers WHERE VID =" & VID & ""

I get:

Syntax error (missing operator) in query expression 'VID ='.

VID is a number,

View Replies !   View Related
Syntax Error
I am getting some syntax error on this line. Can someone see where my error is and how I can change it? I am sure this one will be a easy request for somone to spot.Code:

set rs=conn.Execute("select Last_Name, First_Name, Approval_Number,LH.Dealer_Id, DP.Fax, DP.Dealer_Name, DP.Dealer_Number, lh.Approved_Dt from Loan_Header lh inner join Dealer_Profile dp on dp.dealer_id = lh.dealer_id where dp.dealer_number = '" & dealerNumber & "'" and lh.Soc_Sec_Number = "'" & SocSecNumber & "'")

I am sure it has to do with my quotes on the variables at the end of the query.

View Replies !   View Related
New Syntax Error
Microsoft OLE DB Provider for SQL Server error '80040e14'

Incorrect syntax near ','.
/localassign.asp, line 51

Code:


StrSql = "INSERT INTO [Job Contract Assignments] (CNUM,EPN,Dateassigned,CurrentAssignment,DemoDate, PrimaryDate) VALUES (" & JobsToUpdate & "," & Demonstrator & ",'" & FormatDateTime(Now(),2) & " 12:00:00 AM',1,'" & AssignedDate & " 12:00:00 AM'," & IsPrimaryDate & ")"

View Replies !   View Related
Syntax Error
I guess there's an error with my sql statement

sql="SELECT * FROM Employee Where Emp_Id Like%" &strId

Error message: Syntax error in query expression 'Emp_Id Like%100'.

I have tried:
sql="SELECT * FROM Employee Where Emp_Id Like% &strId"
and
sql="SELECT * FROM Employee Where Emp_Id Like% '"&strId&"' "

View Replies !   View Related
Syntax Error
i am trying to run the following update query, but keep getting an syntax error. i can't seem to figure out where the problem is...

Code:
Set rsProfile = conn.Execute("UPDATE user_profile SET name = '" & Request.QueryString("txtname") & "', year = " & Request.QueryString("txtyear") & ", make = '" & Request.QueryString("txtmake") & "', model = '" & Request.QueryString("txtmodel") & "', engine = '" & Request.QueryString("txtengine") & "', performance = '" & Request.QueryString("txtperformance") & "', ice = '" & Request.QueryString("txtice") & "', suspension = '" & Request.QueryString("txtsuspension") & "', appearence = '" & Request.QueryString("txtappearence") & "', misc = '" & Request.QueryString("txtmisc") & "', location = '" & Request.QueryString("txtloaction") & "', ptnick = '" & Request.QueryString("txtptnick") & "', color = '" & Request.QueryString("txtcolor") & "' WHERE user_id = " & rsUserAvail.Fields("user_id") & "")
sorry about the long line of code. any help is much appreciated!

View Replies !   View Related
Syntax Error
I am getting error "Syntax error " when trying to define a class

Like

Class myClass
Public height
Public ID
Private t_width

View Replies !   View Related
Syntax Error
Im getting the above error on the following line of code:

strSQLLastsPostsMod = "SELECT Top " & intLastestPostsTotal & " discuss.ID, discuss.newsid, discuss.comment "
strSQLLastsPostsMod = strSQLLastsPostsMod & "ORDER BY discuss.date DESC;"

View Replies !   View Related
You Have An Error In Your SQL Syntax
This query using ASP in a DB MySQL, response with error, why?

UPDATE tbl_1 SET Rep = tbl_2.Rep FROM tbl_1 JOIN tbl_2 ON tbl_1.M = tbl_2.M

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tbl_1 JOIN tbl_2 ON tbl_1' at line 1

/test/index.asp, line 21

View Replies !   View Related
Syntax Error
I'm getting this error message:

SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near '2003-06-01' AND '2003-08-01' ORDER BY i_date ASC' at line 1

In the database i_refid is a VARCHAR and i_date is DATE format.

I'm using ASP with a mySQL database, and the string I'm using is:

SET rsFind = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM Invoicez WHERE i_refid = '" & myref & "' AND i_date BETWEEN '" & begindate & "' AND '" & enddate & "' ORDER BY i_date ASC"
rsFind.Open mySQL, strCon

begindate and enddate is being sent as YYYY-MM-DD or YYYY/MM/DD with the same error message.

Can anyone offer any suggestions?

View Replies !   View Related
SQL Syntax Error
What's wrogn with this query?
INSERT INTO Login(Name,Password,Pastor) VALUES ('Bob','whatever','y')

Seems pretty striaghtforward. Using Access 2003. My connection is good,
because I am using it to do all sort of other things, but this insert
statement is throwing me this message, where line 24 is the execute line:

Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/shape/addLogin.asp, line 24

View Replies !   View Related
Getting SYNTAX Error
I am getting a SYNTAX error when I try to edit a field from my admin control panel. Below is the code that edits the information in the database. All the fields in the database are set for either TEXT or NUMBER. Code:

View Replies !   View Related
SQL Syntax Error
I have an SQL Syntax Error but I have no idea what is could be. Here is the code, the resulting SQL string and the error. Code:

SQL="INSERT INTO Users (User, UserType, Password, UserGroup) VALUES "
SQL=SQL & "('"&Request.Form("User")&"',"
SQL=SQL & "'"&Request.Form("UserType")&"',"
SQL=SQL & "'"&Request.Form("Password")&"',"
SQL=SQL & "'"&Request.Form("UserGroup")&"')"



INSERT INTO Users (User, UserType, Password, UserGroup) VALUES ('Bill','Admin','bleh','CSU836')

Error: Syntax error in INSERT INTO statement.

It is probably a pretty dumb problem, but I can't seem to figure it out.

View Replies !   View Related
Syntax Error
PHP Code:

ifrequest.form("SAVE")="AA"THEN

ifrequest.form("plan3")=""then
msg="yoo"
callresponse()
else
response.redirect("login.asp")
endif
endif

PHP Code:

whyasimplescriptlikethisgiveerroron

MicrosoftVBScriptruntimeerror'800a01a8'

Objectrequired:'response'

View Replies !   View Related
Syntax Error
I am trying to update our local volleyball website (as fixtures secretary this is my job). When I try to update the information on the site it comes up with the above error message.

The error points to the line containing con.execute(SQL). I am not sure how much more of the code you need. So please ask if this is not enough. I am relatively new to ASP, having just brought the recently released ASP Sitepoint book.

ASP Code:
SQL = SQL & " WHERE " & identityField & " = " & request(identityField)
'response.write(SQL)
con.execute(SQL)

View Replies !   View Related
Syntax Error
I get this error and can't figure out the correct syntax. Doesn't seem to make a difference changing the quotes around. Code:

View Replies !   View Related
Syntax Error
I have my code like this Code:

If dept="Computers"

Response.Write "<script>" & _
"window.open("deptname.asp?deptno="& getdeptno &")</script>"

End if

Its giving an syntax error

Can someone tell me how to fix it.

View Replies !   View Related
Syntax Error
To get round the problem of users putting ' & " characters in fields they are updating i'm trying to write a function that ill double up ' or "" so they dont affect the sql string. However i keeping getting a syntax error with my function. Any ideas? Code:

View Replies !   View Related
Syntax Error
I dont know the correct way to continue an sql statement onto a new line.

View Replies !   View Related
Error Using <select></select>
I have written some code which should dynamically build a table which is then populated with questionas and possible answers. The format of the answers will vary ie they may be in the form of a radio button which will be rated from 1-5, checkbox or a selectbox.

The first problem I have is if I do not comment out <select></select> I get an error message saying the page can not be found. when I do take it out I get asp timeout. Code:

View Replies !   View Related
Delete Syntax Error
i have a field box in which the users enter their date in the dd/mm/yyyy format, when it gets inserted into the database it would be mm/dd/yyyy

the FormatMonthDate just changes the date to display mm/dd/yyyy

the values get inserted into the pther table but i cant seem to delete them Code:

View Replies !   View Related
Syntax Error With ASPUpload
Ive been working on a form that adds data to a database and saves a file on a spot in the server

The Upload works fine by itself and the Form adds data fine by itself ... but when I use both scripts together it said that I couldnt use request.form Any way the first part of the code is the ASP Uploader portion It saves the file to a folder on the server and then would write out all the form values on the screen, what I want it to do is to write those to specific field names in a database.

The syntax in the Uploader portion uses a command to generically pull all field names and values but nothing to pull specific ones. Code:

View Replies !   View Related
Syntax Error On SQL Statement
I am getting a syntax error on my SQL statement, not sure if I am doing this
right. i am trying to pass a value from another form.

strsql = "select PrinterModel, PrinterName, IP_Address, Location from
Printers where PrinterName = ' & <% =Request.Form(npName) %> & ')"

View Replies !   View Related

Copyright 2005-08 www.BigResource.com, All rights reserved