#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0

    Problem with Queries in MS SQL


    I built an events calendar using classic ASP and an Access 2000 database back when 2000 was the current version, and it was working fine. Now I've uploaded the calendar to my domain on Hostgator, who I assume is using a newer version, and this code gives me an internal server error:

    Code:
    Dim sql
    
    sql = "SELECT DISTINCT SBDC from locations ORDER BY SBDC"
    set rs=conn.Execute(sql)
    I have similar code elsewhere in the calendar where I build the sql string using variables, like this:

    Code:
    sql = "some string"
    sql = sql & "some other string"
    sql = sql & some variable
    etc...
    and that seems to work fine. Any idea why defining sql as a simple string would cause problems?

    Thanks,

    joe
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    15
    Rep Power
    0
    Just investigated further, and I'm not accessing the db at all - that one query string is causing the server error, but even when I remove that line, the other strings aren't successfully querying the db. Hostgator support says all is OK - says that the folder containing the db has read access but not write access, but the page I'm working with only reads the db so there shouldn't be a problem there.

    I'm using this code to open the connection:

    Code:
    set conn=Server.CreateObject("ADODB.Connection")	
    conn.Provider="Microsoft.Jet.OLEDB.4.0"
    conn.Open Server.MapPath("../fpdb/calendar.mdb")
    Anyone see a problem with that?

IMN logo majestic logo threadwatch logo seochat tools logo