1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Data type mismatch

Discussion in 'C#' started by michelle123, Jun 1, 2006.

  1. #1
    I have been searching for answers to the "data type mismatch" error I get but none answered my specific problem, when I created this asp file. Please take a look at my code snippet:


    'insert new member into database
    msql="INSERT into Personals (login,gender,eyecolor,haircolor,birth_date,"&_
    "height,smoker,haschildren,personality, "&_
    "interests,mypassword,myemail,lastupdated)"&_
    "VALUES('"&a_login&"','"&a_gender&"','"&a_eyecolor&"','"&a_haircolor&"','"&a_birth_date&"',"

    &_
    ""&a_height&",'"&a_smoker&"','"&a_haschildren&"','"&a_personality&"',"&_
    "'"&a_interests&"','"&a_password&"','"&a_email&"','"&date()&"')"

    Response.Write (msql) ------>>>LINE 101 Error
    Set rs=ConDB.Execute(msql)

    'Close Connection
    ConDB.Close
    Set ConDB=Nothing
    Set rs=Nothing

    ----I have declared all the variables in another asp file called connection.asp---
    ---My Access database contains these info:
    ID-Autonumber
    Login-Text
    Gender-Text
    Birth_Date-Date/Time
    EyeColor-Text
    HairColor-Text
    Height-Number
    Smoker-Text
    HasChildren-Text
    Personality-Text
    Interests-Text
    LastUpdated-Date/Time
    MyPassword-Text
    MyEmail-Text
    Paid-Number

    ----Now I dont know why I am getting this error:
    Error Type:
    Microsoft JET Database Engine (0x80040E07)
    Data type mismatch in criteria expression.
    /myweb/create_profile.asp, line 101

    Any help will be appreciated.
     
    michelle123, Jun 1, 2006 IP
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    have you tried #'s instead of apostrophes around your date fields? birth date and last updated?
     
    vectorgraphx, Jun 2, 2006 IP
  3. genesis

    genesis Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi
    Use Response.end after this statement Response.Write (msql)

    Maybe the variables are not picking up the values from the form. Just check whether it is picking up all the values or not.
     
    genesis, Jun 4, 2006 IP
  4. dodolls

    dodolls Well-Known Member

    Messages:
    282
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #4
    try to check the birth part of the users input. since it is a string value, u need to convert to date/time value for the database to understand.:eek:
     
    dodolls, Jun 7, 2006 IP