This topic is locked

SEARCH PROBLEM IT DOES NOT WORK

5/5/2005 10:57:57 PM
ASPRunnerPro General questions
Alberto author

Sergey, I can't zip and send you my files but the problem is very clear, every time we do a search it does the same:
ERROR MESSAGE: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'NumeroContrato'.
select [NumeroContrato], [NumeroAgendamiento], [UsuarioCobranzas], [NombreDestinatario], [FechaVenta], [FechaEntrega], [CodigoAsesor], [NombreEnvio], [DireccionEnvio], [CiudadEnvio], [EstadoRegionEnvio], [CodigoPostalEnvio], [PaisEnvio], [TelefonoContacto], [InstruccionesEspeciales], [PrecioContado], [CostoEnvio], [Impuesto], [TotalContado], [PrePaidAmount], [PrePaidMetodo], [CODAmount], [CODMetodo], [DownPayment], [AFinanciar], [Interes], [BalanceTotal], [NumeroCuotas], [MontoCuota], [TotalAPagar], [FormaPago], [AreaVentas], [Status], [FechaSolicitudDespacho], [EntidadDestino], [EmailDestino], [UsuarioDespacho], [ShipVia], [Puntaje], [UsuarioVerificacion] From [dbo].[tbContratos] where [NumeroAgendamiento] =5215 NumeroContrato
It adds the name of the field that is part of the condition. When I use ADVANCED SEARCH with multiple fields it looks like it adds only the first field in the conditions to the SQL Statement as follows.
select [NumeroContrato], [NumeroAgendamiento], [UsuarioCobranzas], [NombreDestinatario], [FechaVenta], [FechaEntrega], [CodigoAsesor], [NombreEnvio], [DireccionEnvio], [CiudadEnvio], [EstadoRegionEnvio], [CodigoPostalEnvio], [PaisEnvio], [TelefonoContacto], [InstruccionesEspeciales], [PrecioContado], [CostoEnvio], [Impuesto], [TotalContado], [PrePaidAmount], [PrePaidMetodo], [CODAmount], [CODMetodo], [DownPayment], [AFinanciar], [Interes], [BalanceTotal], [NumeroCuotas], [MontoCuota], [TotalAPagar], [FormaPago], [AreaVentas], [Status], [FechaSolicitudDespacho], [EntidadDestino], [EmailDestino], [UsuarioDespacho], [ShipVia], [Puntaje], [UsuarioVerificacion] From [dbo].[tbContratos] where 1=1and upper([NumeroContrato] )=upper('MOR0005215') and [NumeroAgendamiento] =5215 NumeroContrato
Please try to help us ASAP since I already put this version in production thinking that was ok.

Thaks for your effort.

Alberto author 5/6/2005

Sergey, I just discovered more details about the error as follows:
Every time we do a search it adds at the end of the SQL Statement the first field of the table. even if i do not use the first field in the conditions it will add it anyways at the end. In Both Search
I did several tests with diferent tables and occurs the same.
select [NumeroCliente], [Nombres], [Apellidos], [Direccion], [Ciudad], [EstadoRegion], [CodigoPostal], [Pais], [TelefonoCasa], [TelefonoCelular], [Empresa], [CargoOcupacion], [TelefonoTrabajo], [Anexo], [Fax], [Email], [FechaNacimiento], [Notas], [Status], [SocialSecurity], [Nacionalidad], [Sexo], [ComunicacionVia] From [dbo].[tbClientes]

where

1=1 and

upper([Nombres] )=upper('carlos') and

upper([Apellidos] )=upper('contreras') and

upper([CargoOcupacion] )=upper('mason') NumeroCliente
I hope it helps to fix the error ASAP

Thanks

I am using MS SQL Server 2000/MS Windows 2003

Alberto author 5/6/2005

Sergey, More info:
The problem I think is with the Order By
Before this line it looks ok
strSQL = strSQL & strOrderByClause
After, we have the first field of the table added with no order by
We have 2 variables
strOrderBy

strOrderByClause

Sergey Kornilov admin 5/10/2005

Alberto,
open your project with new version of ASPRunner Pro 3.2 beta.

Proceed to Step4- List page. Click Order by - Change and set the sorting you need.