If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ASP + MySQL ODBC error 80040e21..?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-21-09, 19:35
Scytzo Scytzo is offline
Registered User
 
Join Date: Apr 2009
Posts: 5
ASP + MySQL ODBC error 80040e21..?

Alright, so I got this website today to 'fix' from my boss, and I have no experience in ASP or MySQL. Hell, I've just started to learn PHP...

So, here's the Error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
ODBC driver does not support the requested properties.
/invCategories.asp, line 6


And the line it's referring to:

oRS.Open sSQL, oConn, 1


I can supply the entire document code if necessary...

Thanks for any help in advance...
Reply With Quote
  #2 (permalink)  
Old 05-21-09, 20:19
Scytzo Scytzo is offline
Registered User
 
Join Date: Apr 2009
Posts: 5
After some fiddling... I got a new error...

Code:
Microsoft VBScript compilation  error '800a03f2'

Expected identifier

/inc/connect.asp, line 2

Dim oConn, rFSO, rFile, rPath, rRS, rSQL, catRS,
------------------------------------------------^
Reply With Quote
  #3 (permalink)  
Old 05-21-09, 20:23
Scytzo Scytzo is offline
Registered User
 
Join Date: Apr 2009
Posts: 5
Nope, back to the original error.
Reply With Quote
  #4 (permalink)  
Old 05-22-09, 12:49
Scytzo Scytzo is offline
Registered User
 
Join Date: Apr 2009
Posts: 5
So, upon much investigation, I have found out that every time the document refers to the "oRS" (whatever that is) it errors out. Any help with this?

I'm getting different error on each page, but always referring to a line of code with "oRS" in it....

Again, any help would be much appreciated.
Reply With Quote
  #5 (permalink)  
Old 05-22-09, 13:02
Rappa21 Rappa21 is offline
Registered User
 
Join Date: May 2009
Posts: 4
For what I understand, you are haveing problems running the query.

Look for the content in the sSQL variable, it should say something like:

Code:
sSQL = "Select * From ...."
Or something like that.
Reply With Quote
  #6 (permalink)  
Old 05-22-09, 13:26
Scytzo Scytzo is offline
Registered User
 
Join Date: Apr 2009
Posts: 5
Code:
If Request("catid") <> "" Then
	  sSQL = "SELECT * FROM PhotoGallery WHERE PhotoCategory = " & catid & " ORDER BY PhotoDate"
	 Else
	  sSQL = "SELECT * FROM PhotoGallery ORDER BY PhotoDate"
	 End If
	 rRS.Open sSQL, oConn, 1
This what I'm looking for?

Last edited by Scytzo; 05-22-09 at 13:29.
Reply With Quote
  #7 (permalink)  
Old 05-22-09, 16:05
Rappa21 Rappa21 is offline
Registered User
 
Join Date: May 2009
Posts: 4
Look, if "PhotoCategory" is not a number type variable, try adding quotes to the query string (the single ones) as follows:

Code:
sSQL = "SELECT * FROM PhotoGallery WHERE PhotoCategory = '" & catid & "' ORDER BY PhotoDate"
Good luck
Reply With Quote
  #8 (permalink)  
Old 05-29-09, 09:08
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,002
Ever heard of SQL Injection?

I'd definately give it a google if I were you and then once you understand the risks, look at using parameterized stored procedures instead of building up a string to execute.

__________________
George
Twitter | Blog
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On