I'm having trouble with this :
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') union (select distinct(gSim_host) from gprsSims where id=) union (select disti' at line 1
where :
Code:
function hostList()
dim dbConn, db_rec, sql
set dbConn = Server.createObject("adodb.connection")
set db_rec = Server.createObject("adodb.recordset")
dbConn.open(db_connstr)
sql = "(select distinct (sSim_host) from srpcSims where id=" &projID& ") union (select distinct(gSim_host) from gprsSims where id=" & projID & ") union (select distinct(tSim_host) from tachSims where id=" & projID &")"
'response.write sql
'response.end
db_rec.open sql, dbConn
while not db_rec.eof
hostList = hostList & "<option>" & db_rec.fields(0) & "</option><br>"
db_rec.movenext
wend
db_rec.close
dbConn.close
set db_rec = nothing
set db_con = nothing
end function