Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 20th, 2004, 08:28 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default Microsoft VBScript compilation (0x800A03EA) - synt

Hi i am trying to select records from a database using the following syntax, before i put in the order by part it works no problem, can anyone see my problem? thanks

SQL = "Select * FROM MainTable WHERE Company LIKE '" & ("%") & request("Company") & ("%") &"' AND Device LIKE '" & ("%") & request("Part") & ("%") &"' AND Division LIKE '" & ("%") & request("Strategy") & ("%") &"' ORDER BY '" & ("%") & request("orderby") & ("%") &'" ASC"
set RS = dbconn.execute(SQL)


 
Old August 20th, 2004, 08:48 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Use this...
Code:
SQL = "Select * FROM MainTable WHERE Company LIKE '%" & request("Company") & "%' AND Device LIKE '%" & request("Part") &"%' AND Division LIKE '%" & request("Strategy") & "%' ORDER BY " & request("orderby") & " ASC"
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old August 20th, 2004, 08:54 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi thanks for your help, i tried this and now i am getting the error
0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Syntax error in ORDER BY clause.
Any ideas?

 
Old August 20th, 2004, 09:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Looks like you are missing the COLUMNNAME after order by and beofer ASC.
Code:
SQL=...
Response.write SQL
Response.end
set RS = dbconn.execute(SQL)
Try the code in blue and post the resulting sql statement here. Will have a look at it.

_________________________
- Vijay G
Strive for Perfection
 
Old August 20th, 2004, 09:51 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a million, it does look like i'm missing the columnname alright, i'll use get instead of post to see if the columname is being sent properly....

Select * FROM MainTable WHERE Company LIKE '%%' AND Device LIKE '%%' AND Division LIKE '%DAC%' ORDER BY ASC

 
Old August 20th, 2004, 09:54 AM
Authorized User
 
Join Date: Jul 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks very much, i wasn't sending the column name correctly! it works perfectly now!

 
Old August 20th, 2004, 10:00 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Glad that it works. Now you can remove off these two lines of code.

Response.write SQL
Response.end

Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old March 29th, 2007, 10:53 PM
Authorized User
 
Join Date: Aug 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi I am trying to connect to a database and I am getting this error below:

Microsoft VBScript compilation (0x800A03EA)
Syntax error

/X/join.asp, line 13, column 61
connObj.Open("DRIVER={Microsoft Access Driver(*.mdb)};DBQ=" &
------------------------------------------------------------^


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

Page:
POST 183 bytes to /X/join.asp

The Line that it is refering to is this:

Dim connObj,strSQL,cmdObj,strSQL2,cmdObj2,strSQL3,cmdO bj3

Dim AddName,AddEmail,AddMailing
Dim AddConfirm,AddCreditcard,AddNamecd,AddExpiredate,A ddTypesrvc,CardNumber
Dim AddUsername,AddPassword

Set connObj = Server.CreateObject("ADODB.Connection")
connObj.Open("DRIVER={Microsoft Access Driver(*.mdb)};DBQ=" &
Server.MapPath("CyberX.mdb"))
:(






Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation (0x800A0400) pendemv Classic ASP Databases 1 September 1st, 2008 02:58 PM
Microsoft VBScript compilation (0x800A0400) joeyjoejnr Classic ASP Databases 2 May 9th, 2007 03:22 AM
Microsoft VBScript compilation (0x800A0400) davidclangley ASP.NET 2.0 Basics 0 February 11th, 2007 10:46 AM
Microsoft VBScript compilation (0x800A03EA) srm_kumar ASP.NET 1.0 and 1.1 Basics 1 November 10th, 2006 01:42 PM
Microsoft VBScript compilation (0x800A0400) cnottingham Classic ASP Databases 2 February 12th, 2004 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.