CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> ASP

 CCDLookup Type Mismatch error

Print topic Send  topic

Author Message

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


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

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

'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.
View profile  Send private message

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

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

Best regards,
View profile  Send private message

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

Many thanks. It works.

Best regards,
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

Internet Database

Visually create Web enabled database applications in minutes.

Home   |    Search   |    Members   |    Register   |    Login

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