Thanks Kevin and Sebastian for your suggestion. I've tried replacing the 'yes' value
with 1. But the same error still keeps popping up. WHen I modified my script, got rid
of CFQUERY and used CFINSERT, it just worked beautifully. I'm just wondering, why does
this work:
<cfscript>
Form.HostName = "Host Test";
Form.RoleContact = 1;
Form.ContactName = "Sales Manager";
</cfscript>
<cfinsert datasource="netinfhosts" tablename="CompanyInfo">
while this doesn't:
<cfquery name="AddAccount" datasource="netinfhosts" debug="Yes">
Insert into CompanyInfo (HostName, RoleContact, ContactName)
Values('Host Test', 1, 'Sales Manager')
</cfquery>
Leong
At 08:52 PM 10/29/2000 -0500, you wrote:
Don't quote the yes value. It is a true false field. Make yes the number 1
with no quotes for yes and 0 for no. It may be a yes no field in access but
it works much better when you supply it a boolean value.
Kevin
----- Original Message -----
From: Harry Kurrosawa <[EMAIL PROTECTED]>
To: CF-Talk <[EMAIL PROTECTED]>
Sent: Sunday, October 29, 2000 8:42 PM
Subject: Datatype Mismatch in Access
> Hi,
>
> I'm wondering if anyone can help with this problem. Since I'm pretty new
to using ColdFusion with MS Access, I can't figure out why the following:
>
> <cfquery name="AddAccount" datasource="netinfhosts" debug="Yes">
> Insert into CompanyInfo (HostName, RoleContact, ContactName)
> Values('Host Test', 'Yes', 'Sales Manager')</cfquery>
>
> causes this error:
>
> ODBC Error Code = 22005 (Error in assignment)
> [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria
expression.
>
> The error occurred while processing an element with a general identifier
of (CFQUERY), occupying document position (10:4) to (10:67)
>
> I've rechecked my database, and the fields, HostName, RoleContact, and
ContactName, have been set as text(50), yes/no, and text(50) respectively.
Is there anything wrong with the SQL statements or was my database not set
up properly?
>
> Thanks,
>
> Harry
>
>
> _____________________________________________________________
>
>
>
------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebarRsts or send a message with
'unsubscribe' in the body to [EMAIL PROTECTED]