Re: data type mismatch

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joe \ (joe_at_bftsi0.UUCP)
Date: 03/16/04


Date: Tue, 16 Mar 2004 01:40:49 -0800


"Neil Fallon" <nfallo@comcast.net> wrote in message <news:Bbz5c.20021$1p.421577@attbi_s54>...

> I'm getting a data type mismatch on a simple insert statement into an Access
> database. The following is the code.
>
> If strTableName = "palm_colors" Then
> strStatement2 = "INSERT INTO palm_colors ([UniqueID], [Category],
> [Dirty], [Secret], [color]) VALUES ('"
> strStatement2 = strStatement2 & Null & "', '"
> strStatement2 = strStatement2 & Null & "', '"
> strStatement2 = strStatement2 & True & "', '"
> strStatement2 = strStatement2 & False & "', '"
> strStatement2 = strStatement2 & txtFields(0).Text & "')"
> End if
>
> UniqueID is a numeric field of type integer
> Category is a numeric field of type integer
> Dirty is a yes/no field of type true/false
> Secret is a yes/no field of type true/false
> color is a text field
>
> All of the fields can be null

What does a Debug.Print strStatement2 show? What will happen
when someone tries to add an entry with an apostrophe in it?
(Updating through Recordsets has gotten a bum rap, IMO) Why
are these fields nullable, anyway? Null usually causes more
and nastier problems than it solves.

--
Joe Foster <mailto:jlfoster%40znet.com>  DC8s in Spaace: <http://www.xenu.net/>
WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!


Relevant Pages

  • data type mismatch
    ... UniqueID is a numeric field of type integer ... Secret is a yes/no field of type true/false ...
    (microsoft.public.vb.general.discussion)
  • Re: data type mismatch
    ... The Palm device assigns the value to the null fields. ... the Palm pdb file uses. ... >> UniqueID is a numeric field of type integer ...
    (microsoft.public.vb.general.discussion)
  • Re: data type mismatch
    ... If you're trying to put null in there, you don't want to put quotes around ... Currently you're trying to put strings into integer fields. ... > UniqueID is a numeric field of type integer ...
    (microsoft.public.vb.general.discussion)
  • Re: Access Replication
    ... replicate a database has a numeric field called "Status". ... MsysExchangeLog is a local table that records the synchs that have ...
    (microsoft.public.access.tablesdbdesign)
  • Re: heap memory
    ... I have a JDBC interface to an Oracle database. ... so a "select count" not solve my trouble. ... I can exctract 50000 rows with only a numeric field (and this works ... change it to instead process it as a stream of rows! ...
    (comp.lang.java.programmer)