Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2009
    Posts
    5

    Unanswered: 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...

  2. #2
    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,
    ------------------------------------------------^

  3. #3
    Join Date
    Apr 2009
    Posts
    5
    Nope, back to the original error.

  4. #4
    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.

  5. #5
    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.

  6. #6
    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.

  7. #7
    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

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    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
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •