"order By" Statement Gives An Error

this is my code for retrieving messages for a topic: Code:

' Find All Messages Posted In Topic
strSQLTopicMessages = strSQLTopicMessages & "SELECT * "
strSQLTopicMessages = strSQLTopicMessages & "FROM tblMessages "
strSQLTopicMessages = strSQLTopicMessages & "WHERE fldTopicID = "
strSQLTopicMessages = strSQLTopicMessages & strTopicID
objRSTopicMessages.PageSize = iPageSize
objRSTopicMessages.CacheSize = iPageSize
objRSTopicMessages.Open strSQLTopicMessages, objConn, adOpenStatic
' /Find All Messages Posted In Topic

I have tried to add an "order by" statement, but i gve syntax error. isn't it possible to use an "order by" in this case?

View Replies


ADVERTISEMENT

SQL Order By Statement

Does anyone know how to organise data in alphabetical order when using a select statement???

When i use mine, i have been using ASC and it justs put the newest record added!

View Replies View Related

A Function In An Order By Statement

Can You Put A Function In An Order By Statement. Assume That The Outcome Of The Interest Function Is Always One.

"SELECT TOP "&quantity&" * FROM Content WHERE "& q &" ORDER BY Interest(Keyword)"

View Replies View Related

Multiple Dropdowns To Create An Arrary To Form ORDER BY Statement

Creating a form that allows people to search a ticket database. One criteria I would like to add is to give the people the option to sort the results by selecting criteria for a dropdown.

My first thought was to create 3 dropdowns with the same name, get the data and add it to the SQL string. It worked great except for when someone decided to leave anything blank.
Here are my dropdowns here: Code:

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

Error: CDONTS.NewMail.1, ASP 0220 (0x80020009), This ASP File Must Be Transacted In Order To Use The ObjectContext Object.

Hey people,

I have just tested code I pulled from the chilli!Mail tutorial to email data via an ASP page.

It worked perfectly the first time the page was loaded, however now I am getting the following error:

Error Type:
CDONTS.NewMail.1, ASP 0220 (0x80020009)
This ASP file must be transacted in order to use the ObjectContext object.
/ContinuousImprovements/test.asp, line 29

I haven't seen this error before and am not too sure what it means, any help would be appreciated.

The code is below:...

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

SQL Statement Error?!

Im trying to use a sesson statement within an SQL Statement:

sql = "SELECT * FROM tblNumbers WHERE AllocatedTo=" & Session("Company") &
""

And get the error:

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/numberlist.asp, line 31

Anyone got any ideas? Surely this can only be something basic?

View Replies View Related

If Statement Error?

I am trying to create a simple library system to document all our resources. Here is the
Code:

View Replies View Related

Dim Statement Error

Dim cc As Currency

Microsoft VBScript compilation error '800a0401'

Expected end of statement

process.asp, line 33

Dim cc As Currency
-------^
I am doing something wrong here. How should this be coded?

View Replies View Related

Statement Error

I am trying to select all records from a table, however the table name I want to be a variable. I tried to do the following (code below), but it does not work. Any ideas on how to use a variable as part of a table name?
tableName = Request.Form("tableName")
tableName = REPLACE(tableName,"%20"," ")
set objConn=Server.CreateObject("ADODB.Connection")
objConn.Provider="Microsoft.Jet.OLEDB.4.0"
objConn.Open(Server.Mappath("db2/email.mdb"))
SET rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT * FROM" & tableName, objConn

View Replies View Related

Error In Select Statement Using Where And Between

Find below the error I get when the code below is executed

Code:

splitval = split(request.form("start")," ")
dep = splitval(0)

splitval1 = split(request.form("end")," ")
dep1 = splitval1(0)

"SELECT * FROM Info WHERE requestDate BETWEEN dep AND dep1 "

error:
No value given for one or more required parameters.

Can someone help correct the error in the 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

Sql Update Statement Error

I am trying to run a simple update statement through asp and for the life of me can't figure out why it isn't working. I was wondering if anyone could look at this and tell me what may be wrong: Code:

View Replies View Related

Expected End Statement Error

I need the end statement to this sql query, but I am doing something wrong, is there site where they show you the different forms of ending sql statments in ASP? Code:

View Replies View Related

Updateable Statement Error

when i execute any "Insert..." sql,i get this error message:

Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

can any one show me how to solve?

View Replies View Related

Error On Insert Into Statement

i have this error on the regisration page of the website i'm doing.
Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/Shop/register_process_corp.asp, line 40

SQL = "INSERT INTO
------------------^

Code:

View Replies View Related

INSERT Statement Error

The block of code below shows how I am inserting field values into my dbase table:

strSQLStatement = "INSERT INTO tblArticles
(handid,ArticleDate,sport,articleheader, fpick,articleText) "_
& "SELECT '" & handid & "' As handid, '" _
& ArticleDate & "' As ArticleDate, '" _
& sport & " As sport, " _
& articleheader & "' As articleheader, '" _
& fpick & "' As fpick, '" _
& articleText & "' As articleText;"

Conn.Execute(strSQLStatement)

but I am getting an "Insert statement contains fewer items than the insert list" error , when in fact I am not (both 6 field names).

View Replies View Related

Error With Formatcurrency Statement

I got the following line in the formatcurrency statement that is giving error.

Response.write "<TD ALIGN=RIGHT WIDTH='10%' >" &
FormatCurrency(TotPersonnel) & "</TD>" & vbCRLF

The error message is: Error Type:

Microsoft VBScript runtime (0x800A000D)
Type mismatch: 'formatcurrency'
/gwisprod/FSR_EditDetailPrint.asp, line 345

I found out that if TotPersonnel field contains null value, the above error gets generated.

View Replies View Related

Data Type Error In Sql Statement

i going to execute this sql statement...and the error come up.. why?

Select * From members Where ID = '123'

pls note that the type of ID is autonumber

is it becoz of type of ID is autonumber? how to solve this problem??

View Replies View Related

Syntax Error In INSERT INTO Statement.

Now I know I posted this elsewhere twice but no one seems to even be looking at them. I really am stumped by this problem.

I recieve the error:
Microsoft JET Database Engine error '80040e14'

Syntax error in INSERT INTO statement.

/quizmaker/admin/create_teacher.asp, line 20

DIM mySQL
mySQL = "INSERT INTO users(user, password) VALUES('"& uname &"', "& pword &")"
USERS1.open mySQL , objConn <----- Line 20.

View Replies View Related

Syntax Error In INSERT INTO Statement???

Syntax error in INSERT INTO statement.

Please download the attachment and unzip it.

I have 4 files:

Starting with "signup.asp" - fill up the registration form. this will forward you to next form.

"signup_process.asp" - process the filled form
"signup_success.asp" - indicate that register successfully
"Database.mdb" - the database file (MS Access 2000 format)

My problem occurs in "signup_process.asp".
The error message found in IE:

Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/myweb/signup_process.asp, line 31

I look through my code, but found no mistake.

But why still I cannot add the information in the form into the "Database.mdb"?

View Replies View Related

Error In ASP Input Text Statement

I want to capture the value of variable into a hidden input test field, using the following code.Code:

<input type="hidden" name="selectedby" size="20" value="<%'strNTUser'%>">

When i run the code the variable value is not captured in the field "selectedby". strNTUser is the variable.

View Replies View Related

Syntax Error In INSERT INTO Statement

I've see this error message when I try to submit my form..

Help with Syntax error in INSERT INTO statement. line 153

Here's the SQL Code:

View Replies View Related

Syntax Error In UPDATE Statement

I'm having trouble with an SQL UPDATE string updating Microsoft Access 2000 with jet engine using ASP classic. I can't see what could be going wrong, as far as I can tell it's fine. I have tried surrounding my field names with brackets [] to no avail.

The error I receive is: Code:

View Replies View Related

Error (0x800A0401) Expected End Of Statement

during the creation of an HTML page using asp variable I have this
problem:

Microsoft VBScript compilation (0x800A0401) Expected end of statement
/asp/pages/connect1_1.asp, line 27, column 35
strtable = strtable & "<tr valign="top">" &

The code is the following: Code:

View Replies View Related

Syntax Error In UPDATE Statement

i'm trying to update a row in my Access Database by the AD_ID... i get the following error:

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

[Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement.

/alterantique1.asp, line 35

Here is the code:

View Replies View Related

Syntax Error In INSERT INTO Statement

My Code is as follows, im basically trying to get the value from a radio button from another page for a vote, take the value thats allready in the table add 1 to the value and then insert it back into the database, then create a voted cookie and redirect back to the same page to view the vote results. Code:

View Replies View Related

Syntax Error In UPDATE Statement.

SQL = "UPDATE * FROM IME_request SET instructName = '" &InstructName& "', email = '" &email& "', school = '"&school&"', courseNumber='"&courseNumber&"', dateMonth = '"&dateMonth&"', dateYear = '"&dateYear&"', dateDay = '"&dateDay&"', description = '"&description&"', instructDesign = '"&instructDesign&"', techranger = '"& techranger & "', IP= '"&IP&"', completed = '"&completed&"', feedback = '"&feedback&"' WHERE courseNumber='" &courseNumber&"' "


I have a form that I want to update my database. I am receiving an error that reads:

Syntax error in UPDATE statement.

View Replies View Related

Syntax Error In UPDATE Statement.

I'm trying to update my counter in DB (Access) using sql query but the following error appears

Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/cms/modules/test.asp, line 14

How could i solve this problem, here is sql query that i'm trying to run

sql = "UPDATE articles SET counter=counter+1 where (((aid) ="&aid&"))" .

View Replies View Related

Syntax Error In INSERT INTO Statement.

I keep getting the same error... Syntax error in INSERT INTO statement. (line 14) Code:

View Replies View Related

INSERT Statement Error In .asp File

I am making a masters page with delete, update , and insert fuctionality, i am using the insert.asp page with a form to submit the data and insert it in the database by prossesing a seperate page called insert_prosessor that has the Insert Statement to insert the data.

Now i am having trouble with the insert_prosessor as it's ERROR message reads" syntax error in INSERT Statement" I cant find the problem.. Code:

View Replies View Related

Syntax Error In UPDATE Statement

What am I doing wrong with my Update statement in with
javascript? Code:

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved