CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 CCDLookup Type Mismatch error

Print topic Send  topic

Author Message
Dorin

Posts: 50
Posted: 09/30/2009, 11:58 PM

Hello,

On a record form I have to make a simple validation against duplicate records before insert. So I put the bellow code on On Validate event:

Dim TPMConn
Dim Place
Dim Building
Set TPMConn = New clsDBconnection1
TPMConn.Open

Place = CCDLookUp("place", "_transactions", "i_id=" & DBConnection1.ToSQL(CCGetParam("id",""), ccsInteger) , DBConnection1)
Building = DBConnection1.ToSQL(TransactionsDetailsRec.i_building.Value,ccsinteger)

If (CCDLookUp("COUNT(*)", "view_buildings", "Building = " & Building AND "Place = " & "'" & Place & "'" , DBConnection1)) > 0 then

TransactionsDetailsRec.Errors.addError("Error: This building is ocupied!")

End If

'TPMConn.Close
'Set TPMConn = Nothing

This event give, for example: Type mismatch: '[string: "Building = 4"]' . (4 cames from a record form list box which has the bound column declared as integer.)

Strange is that both WHERE parameters works separately without any error. Only when I try to combine them with the AND operator I get the above error.

I use SQL database. The Building field is integer. The Place is varchar.

Any help will be greatly appreciate.
Thanks
View profile  Send private message
mrachow


Posts: 509
Posted: 10/01/2009, 11:50 PM

& Building & " AND " & "Place ...
or
& Building & " AND Place ...

_________________
Best regards,
Michael
View profile  Send private message
Dorin

Posts: 50
Posted: 10/02/2009, 3:49 AM

Many thanks. It works.

Best regards,
Dorin
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.