Slopey
Posts: 33
|
| Posted: 08/30/2006, 5:44 AM |
|
Hi there,
I'm trying to query a table with the Visual Query Builder (and using ASP) but I'm unable to search for records where a field is not equal to a space character, i.e:
SELECT * FROM Client WHERE ClientLastName <> ' ';
If i enter something like the above, the builder creates an expression Expr0 which is a text expression, but when I try and load the page, I always get an error in the Classes.asp in the AddParameter function, with a null value for a CStr.
Occasionally, the Expr will be added with a value of "", and if I change it to " ", CodeCharge then crashes with an application error.
Finally, when I change from SQL to Table view in the Visual Query Builder, it always drops the table I want to query and I've got to re-add it. 
Any ideas?
|
 |
 |
Slopey
Posts: 33
|
| Posted: 09/26/2006, 3:04 AM |
|
Bump - has no-one had a similar issue? How can you search on the space character in the Visual Query Builder???
|
 |
 |
Oper
Posts: 1195
|
| Posted: 09/26/2006, 10:49 AM |
|
try checking against Null
NOT NULL
personaly i havent tested chking Against empty, no codecharge now cuase not at office.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
Slopey
Posts: 33
|
| Posted: 09/26/2006, 11:02 AM |
|
But the field is not null. I want to specifically exclude records where the field contains a single space character. If I check NOT NULL, it returns all the rows as expected.
Using the space character as the value of the expression causes a Cstr null error in Classes.asp, and crashes the IDE with an application error.
|
 |
 |
Oper
Posts: 1195
|
| Posted: 09/26/2006, 11:12 AM |
|
ok gotit now, i will test that.
Question: what database you using?
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)
http://www.PremiumWebTemplate.com
Affiliation Web Site Templates
Please do backup first |
 |
 |
FrankR
Posts: 154
|
| Posted: 09/26/2006, 12:03 PM |
|
Quote Slopey:
Hi there,
I'm trying to query a table with the Visual Query Builder (and using ASP) but I'm unable to search for records where a field is not equal to a space character, i.e:
SELECT * FROM Client WHERE ClientLastName <> ' ';
If i enter something like the above, the builder creates an expression Expr0 which is a text expression, but when I try and load the page, I always get an error in the Classes.asp in the AddParameter function, with a null value for a CStr.
Occasionally, the Expr will be added with a value of "", and if I change it to " ", CodeCharge then crashes with an application error.
Finally, when I change from SQL to Table view in the Visual Query Builder, it always drops the table I want to query and I've got to re-add it.
Any ideas?
I do exactly this - successfully.
After setting that up in the Query Builder, be sure that
Type:
is set to
Expression
Also, what DB Engine are you using?
_________________
FR |
 |
 |
Slopey
Posts: 33
|
| Posted: 09/27/2006, 7:00 AM |
|
I'm using SQL Server.
The visual query builder seems to have several issues when I use it - from crashing with an application error to creating a malformed SQL string. i.e.
SELECT * FROM PatientWHERE .....
It does put a space between the table and the WHERE keyword. Also, if I then go back to Table view, it drops the source table completely from the SQL string.
I'll recheck the code to ensure I'm using Expression type for the parameter, but last time I checked I was.
|
 |
 |
|