ASP - MYSQL select problems
am 11.12.2006 10:48:49 von kevinfairsI have an asp application, which looks at three database tables, and
retreives results, the SQL is not massively complex, but long
sConnection = "my connection string goes here"
Set strCon = Server.CreateObject("ADODB.Connection")
strCon.Open(sConnection)
set rsView = Server.CreateObject("ADODB.recordset")
sql = "SELECT TBL_EMPLOYEE.Employee_ID, TBL_EMPLOYEE.Employee_Forename,
TBL_EMPLOYEE.Employee_Surname,
TBL_EMPLOYEE.Employee_Sex,TBL_EMPLOYEE.Employee_Holiday_Allo wance,
TBL_EMPLOYEE.Employee_Place_Of_Work, TBL_EMPLOYEE.Employee_Job_Title,
concat(TBL_EMPLOYEE_1.Employee_Forename ,' ' ,
TBL_EMPLOYEE_1.Employee_Surname) AS V_Mgr_Name,
TBL_EMPLOYEE_1.Employee_ID AS v_mgr_ID, TBL_LOGIN.login_username,
TBL_LOGIN.login_password, TBL_LOGIN.login_email from TBL_EMPLOYEE LEFT
OUTER JOIN TBL_EMPLOYEE AS TBL_EMPLOYEE_1 ON
TBL_EMPLOYEE.Employee_Manager_ID = TBL_EMPLOYEE_1.Employee_ID INNER
JOIN TBL_LOGIN ON TBL_EMPLOYEE.Employee_ID = TBL_LOGIN.Employee_ID"
rsview.open sql, strcon
It works fine, until I add a field such as below:
sConnection = "connection stgring goes here"
Set strCon = Server.CreateObject("ADODB.Connection")
strCon.Open(sConnection)
set rsView = Server.CreateObject("ADODB.recordset")
sql = "SELECT TBL_EMPLOYEE.Employee_ID, TBL_EMPLOYEE.Employee_Forename,
TBL_EMPLOYEE.Employee_Surname,
TBL_EMPLOYEE.Employee_Sex,TBL_EMPLOYEE.Employee_Holiday_Allo wance,
TBL_EMPLOYEE.Employee_Place_Of_Work, TBL_EMPLOYEE.Employee_Job_Title,
concat(TBL_EMPLOYEE_1.Employee_Forename ,' ' ,
TBL_EMPLOYEE_1.Employee_Surname) AS V_Mgr_Name,
TBL_EMPLOYEE_1.Employee_ID AS v_mgr_ID, TBL_LOGIN.login_username,
TBL_LOGIN.login_password, TBL_LOGIN.login_email,
TBL_EMPLOYEE.Employee_NINO, TBL_EMPLOYEE.Employee_Payroll,
TBL_EMPLOYEE.Employee_FTE from TBL_EMPLOYEE LEFT OUTER JOIN
TBL_EMPLOYEE AS TBL_EMPLOYEE_1 ON TBL_EMPLOYEE.Employee_Manager_ID =
TBL_EMPLOYEE_1.Employee_ID INNER JOIN TBL_LOGIN ON
TBL_EMPLOYEE.Employee_ID = TBL_LOGIN.Employee_ID"
rsview.open sql, strcon
Where it returns no rows. I've using mySQL5, and know that there is a
way of using views, but my webhosts have disabled the create or replace
views command for me (nice!)
Is there a limit to the number of fields I can return, or the length of
a select statement (I know in oracle the select cannot be more than 64k
diana nodes), but don't suppose my statement will be hitting that as
it's not massively complext.
any help greatly appreciated