Subject: Strange Error inh STRSQL
Posted By: alirezaaali Post Date: 8/5/2007 11:42:24 AM
 I use the source code below:

<%
'read strings from export page
Dim strtilekind,strtilesize,strmosaic,strgranite
strtilekind=request.Form("tilekind")
strtilesize=request.Form("tilesize")
strmosaic=request.Form("mosaic")
strgranite=request.Form("granite")

Dim StrSQL
If strtilekind ="---" and strtilesize ="" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="---" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="---" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall') ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="15x45" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor' AND tile_size='15x45') ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="30x60" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor' AND tile_size='30x60') ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="33x33" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor' AND tile_size='33x33') ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="33x55" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor' AND tile_size='33x55') ORDER BY sale_model_no ASC"
Else If strtilekind ="Floor" and strtilesize ="40x40" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Floor' AND tile_size='40x40') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="15x15" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='15x15') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="20x20" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='20x20') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="20x25" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='20x25') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="20x30" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='20x30') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="25x25" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='25x25') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="25x33" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='25x33') ORDER BY sale_model_no ASC"
Else If strtilekind ="Wall" and strtilesize ="25x40" and strmosaic="---" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Wall' AND tile_size='25x40') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="Press" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Mosaic' AND tile_size='Press') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="Puzzel" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Mosaic' AND tile_size='Puzzel') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="Elevation" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Mosaic' AND tile_size='Elevation') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="Washbeton" and strgranite="---" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='Mosaic' AND tile_size='Washbeton') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="---" and strgranite="Pepper&Salt" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='granite' AND tile_size='pepper&salt') ORDER BY sale_model_no ASC"
Else If strtilekind ="---" and strtilesize ="" and strmosaic="---" and strgranite="Solublesalt" then
    StrSQL="SELECT sale_model_no,type,tile_size,water_absorption,polished,varnished,firing _type,certifications,MOQ,available,other_sizes,colores  FROM tblproducts  Where(type='granite' AND tile_size='Solublesalt') ORDER BY sale_model_no ASC"
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
 
Dim ObjRS
Set objRS=Server.CreateObject("ADODB.Recordset")
objRS.open StrSQL,objconn
%>

and i get the error below :
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/ravimex/product_show.asp, line 79

I Really Love to learn ASP

I Really Love to learn ASP
Reply By: Imar Reply Date: 8/5/2007 11:56:35 AM
Hi there,

Code like this is pretty hard to debug, especially for others that didn't write it.

What may help is writing out the SQL statement before you execute it. E.g.:

Response.Write("Sql is " & StrSQL)
Response.End

What do you get? Does it look like a valid SQL statement?

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004

Go to topic 63677

Return to index page 2
Return to index page 1