If Then Syntax
i am having some trouble rembering the correct syntax for a If Then Statement here is my code.
<% If Request.QueryString("access") = "false" Then %>
<tr>
<td colspan="2" bgcolor="#FFFFFF" class="mediumRed">The User
ID and Password combination has failed.<br> <br>
Please try again.</td>
</tr>
<% Else If rsGettblCouples.Fields.Item("StopDate") = "1/1/1900" Then %>
<tr>
<td colspan="2" bgcolor="FFFFFF" class="mediumRed"> The User has already<br>
completed the online scoring.<br>Please Contact your facilitator.</td>
</tr>
<% End If %>
<% End If %>
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Where NOT IN ( ) Syntax
Can I use this syntax Where NOT IN (".....) in a situation I don't want to select items in the list. If not what other ways can do that.
Syntax Help
I'm just trying to display a user's FIRST name and the FIRST INITIAL of the last name on my asp web page. This works to displays their "firstName" and "lastName": Code: <%=oUsers("firstName")%> <%=oUsers("lastName")%> But I get a variety of vbscript or asp syntax errors when I try to trim the "lastName" using something like Code: <%=oUsers("firstName")%> <%=oUsers(replace(left("lastName",1))%> How do get this simple task done? (If it makes any difference, the whole thing is inside html <td></td> tags as part of a table)
Syntax
My asp syntax is very lacking, it seems the double quotes that have been done by me are not what asp is looking for. Anyone that could correct my faulty thinking would be thanked.
Syntax
Sorry to have to ask a dumb question, but it's just one of those things I'm having trouble figuring out. I have the following:Code: <% If cLng(rs("tcv1")) > cLng(rs("tv1"))-cLng(DSHIFTCOUNT) Then Blah Blah Blah %> that I'm running as part of a loop. I'm trying to increment the "1" in "tcv1" each time I loop through, but I'm not sure of the syntax to insert a variable in where the 1 is.
SQL Syntax
I can't see to find where the syntax is wrong because I can do the query just fine in access but my asp page gets this error Microsoft JET Database Engine error '80040e14' Syntax error in INSERT INTO statement. Here is what the insert looks like when I print it out in the page INSERT INTO tblusers (username,password,[Timestamp],email) VALUES('testuser', 'c4ca4238a0b923820dcc509a6f75849b', '10/16/2004', 'me@home.com') Here is the code:
SQL Syntax
I am trying to query a database for 2 conditions but I can't get the query to work. Can anybody see a problem with this line of code?Code: strQuery="SELECT Count(*) AS intTotal FROM tbl_artists WHERE fld_artist_name = '" & strReqname & "'" "AND fld_user_id ='"& strUsername & "'",objConn,,,adCMDText objRS.Open strQuery,objConn,,,adCMDText numRecords = objRS("intTotal")
SQL Syntax
I have a textarea and have named it category_One. I have sent the data in this form on using the POST method contents_category_One = Request.Form("category_One") I have then used the following sql statement sql = "INSERT INTO tableName(Category_One) VALUES ('"& contents_category_One &"');" If someone inserts ' in the text box, this value is causing a syntax error in the sql statement.
SQL Syntax
The WHERE part of my select needs to pull out where the date column is empty. If there isn't a date, it shows NULL in the database (SQL7)."WHERE eligibility_dt <> NULL" doesn't work. what am i forgetting?
ASP Syntax
I need help with ASP. when i post data to the database, do the records in my form need to be in the same amount as the database records?
Sql Syntax
Would anyone have some syntax for a query (SQL2000) that would return results for records that are over 24 hours old (date field is smallDateTime)?
Syntax,JS
I believed that there is a wrong syntax on the window.open line...Can anyone spot it ? Code: strLocation = "Sch_As_FollowAct.asp?drvid=" & request("drv") & "&u=" & uday(0) response.write "<script>" & vbCrLf response.write "window.open('" & strLocation & "' & ",menubar=1,resizable=1,width=350,height=250");" & vbCrLf response.write "</script>"
Syntax
Can anybody tell me about this: conn.ConnectionString = "SELECT [Customernr], [Customername], [OrderID], [Orderdate], [Itemname], [Ordersum], [Orderdiscount], [Orderprice], [Orderamount] " + " " + "WHERE Customernr = "' + <%txtCustnr.Text %+ '" FROM [CustomerOrderHistory] ORDER BY [Orderdate]"; So what I try to obtain is getting a value from a textbox: txtCustnr.The code is C# in an ASP 2.0 application
Syntax
I want to assing the value of x1,x2,x3 into array.. ...However, it doesnt I belive the syntax is not correct. <% dim a(4),i x1 = DateDiff("n", "10:40AM", "12:40PM") x2 = DateDiff("n", "11:40AM", "12:45PM") x3 = DateDiff("n", "8:35AM", "12:45PM") a(0) = 0 for i = 1 to 3 a(i) = x & i response.write "Difference is :" & a(i) & "</br>" next %>
Syntax
With a variable called rs, what is the syntax to reference a Recordset result field called FirstName?
Syntax 101
Can someone direct me a set of rules for building strings in ASP? I'm always getting stuck on when to use a quote (") or apostrophe{'} or both. This simple string is giving me fits... Response.Redirect("test3.asp?orderno='" & (rsProducts.Fields.Item("OrderNo").Value) & "')" I can't seem to get the right combination.
Dsn Less Syntax
What's wrong with the syntax in this connection string? It's a DSN less connection to an Access DB. <% Set Conn = Server.CreateObject("ADODB.Connection") MM_GenKAccess_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ Server.MapPath("authors.mdb") & ";" & _ Jet OLEDB:Database Password=48912; & _ Jet OLEDB:System database=" & Server.MapPath("system.mdw") & ";" & _ conn.open MM_GenKAccess_STRING %>
Do While Not - Syntax
I want to update multiple rows in an SQL table. Presently, it's populating all rows with the same data based on the first row. It's not looping through all records one at a time. Is this the correct syntax. <% rsOD 'recordset up here %> <% Dim DataConn1 Set DataConn1 = Server.CreateObject("ADODB.Connection") DataConn1.Open MMSTRING Do While Not rsOD.EOF 'SQL UPDATE statement here DataConn1.Execute(SQL) rsOD.MoveNext Loop %>
Syntax Of URL
Can any one tell me why this snippet is not showing the a href correctly. Sorry, not sure of ASP syntax as yet... Response.Write Highlight(myTextwo, "", "", "<a href=""url.com=" & CInt(rsrch("tablcolumn")) & """ target=""_blank"">" & rsrch("othercolumn")) & "</a>"
Syntax ASP
Another slight problem with syntax of asp, basically I'm pulling an image file name from my database (image1.jpg) and using the images directory on my web server to display my picture, make sense? Code:
Update Syntax
I am trying to update my database with hidden fields that are being requested from a previous page such as: hfSectionOneScore hfSectionTwoScore hfSectionThreeScore I'm not familiar how to write an UPDATE statement, and would like some help. I'm thinking that it is something like this: UPDATE Director_Appraisals SET Section1Score = request("hfSectionOneScore"), Section2Score = request("hfSectionTwoScore"), Section3Score = request("hfSectionThreeScore"), WHERE UserID = request("hfUserID"); Of course there are more columns, but am I on the right track? Does the syntax look correct?
SQL Syntax Near The = Sign
I am concatenating the firstname and lastname in the SQL query in the ASP page. I get the error: Syntax error near = This query works in Access. <input type=hidden value="<%=strNetworkID%>" name=""networkid"> "SELECT" EmpID, FirstName + ' ' + LastName as Employee_Name, NetworkID FROM Employee WHERE networkID = " & Request.form("networkid")
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.
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 "."
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.
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.
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
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
Function Syntax
I have a replace function which should replace a smiley tag with the HTML for the smiley image. can you tell me where this is going wrong please? Code: FUNCTION insertSmilies( tempString ) tempString = replace(tempString,":D ", "<img src=""images/smilies/icon_biggrin.gif"" width=""15"" height=""15"" class=""subScript"" /> ") insertSmilies = trim(tempString) END FUNCTION The HTML output looks like this: Code: <img src=''images/smilies/icon_biggrin.gif'' width=''15'' height=''15'' class=''subScript'' / I can't arrange the speach marks to output the full image tag,it keeps leaving off the end.
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.
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,
Incorrect Syntax Near '' ?
I get this error with this sql statement in MSSQLincorrect syntax near '' ? this is part or the sql statement:- ORDER BY Sum([Ratings].[Rating])Count([Ratings].[RatingID]) DESC
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.
SQL LIMIT Syntax
Anyone used LIMIT in their queries before?? I've been reading up on it, but all of the examples I tried don't seem to work. Here is what I have:Code: Set rs = CatalogCS2.Execute("SELECT * FROM products p " & _ " INNER JOIN applications a ON p.prodcode = a.prodcode " & _ " INNER JOIN inventory i ON p.prodcode = i.prodcode " & _ " WHERE DATEDIFF(d, a.app_launchdate, getdate()) <= '30' " & _ " ORDER BY a.app_launchdate DESC LIMIT 0,10 ") Seems pretty straight forward, but I can't really find any good articles on it.
Correct Syntax
I have a form where users can enter search criteria for various products. now, if this form has 2 fields, colour and size (it wil have more but I'm assuming the the principle for two fields will be the same for ten fields) what would be the correct syntax for performing a query where the user didn't enter a criteria for both fields? the search string would be strSQL = "SELECT * FROM products where colour = " & "'" & request.form("searchstrcolour") & "'" & "AND size =" & "'" request.form("searchstrsize") & "'" & " ORDER by price" so if the user selects blue and large, thats fine but what if the user only selected say blue and didn't bother with the size? is there a wild card that I could use?
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 & ")"
INSERT INTO - Syntax
ive made the most simple page in the world in ASP, and I cannot for the life of me figure out why this page doesn work. whenever I try, it comes up woth "syntax error in statement".. Code:
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&"' "
Statement Syntax
I'm using the following Insert statement which is giving me an error. query="Insert Into "& CurrentSeason() &" (pkDate, Players(Goals)") Values (#31/12/2004#, '"&strOpponent&"')" cnDB.Execute(query) I think this is occurring as one of my field names has brackets in it. Can someone please tell me how I can adjust the syntax of my insert statement so it allows me to include brackets? Is it possible as I have played around with the syntax and received syntax errors.
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!
For Loop Bad Syntax
The folder_num variable returns the number of folders from another page. Next I have a loop that will declare an individual variable for each folder name. However, it does not work... folder_num = request.querystring("fnum") for i = 1 to folder_num fldrname(i) = request.querystring("fldr(i)") next
Syntax Error
I am getting error "Syntax error " when trying to define a class Like Class myClass Public height Public ID Private t_width
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;"
Date Syntax
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:
Syntax Check
i have to show an alert so this is my code: if(document.formCategory.txtprice.value != "") { var pricelist=document.formCategory.txtprice.value; var pricelist1=Left(pricelist, 1); alert(pricelist1); return false; } the data in txtprice is like this $45.00 i want to show an alert like this 45.00 but its not popping the alert is Left the right syntax in javscript.
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
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?
SQL DROP Syntax
I have an ASP file that is part of a management script I've been working on. I'm using (or at least trying to use) the SQL DROP command, but no matter what I do, I can't make it work. Can someone take a look at it and tell me where I've messed up? Code:
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
|