Results 1 to 3 of 3
  1. #1
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Frontpage ASP to Access DB Type Mismatch (2002)

    Hello,

    I am gathering data with an ASP page written in Frontpage which I wish to store in an existing Access DB. The database has fields that are lookups, most are as this is a questionaire. The majority of the fields are "Satisfied, Not Satisfied or N/A". So I created a lookup in these fields, in the DB. However as we all know when Access does this it also changes the data type to "Number". Now whenever I try to post data from my ASP page to this database I get a "Type Mismatch" error and I can only assume it is because of the lookups being deemed "Numbers"? Anybody know a way around this?

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Frontpage ASP to Access DB Type Mismatch (2002)

    A couple of thoughts on your problem:

    1) It sounds like you changed the data type in your Access table from a text value ("Satisfied, Not Satisfied, N/A") to a number field which is related to a lookup table storing the values. If this is correct, then you'll need to update your ASP page accordingly.

    I assume your ASP control is a drop-down box. If this is correct, then you should be able to set the values to the necessary numbers (matching the numbers in the lookup table in Access) and set the labels to anything you like (presumably "Satisfied, Not Satisfied, N/A").

    2) It's been a long time since I've worked with ASP in FrontPage (I do it all by hand now), but web forms usually treat all values as strings. Therefore, you sometimes need to throw a CLng() or CInt() function around the variable before it's written to the Access database in order to feed Access the correct data type.

    If all else fails, change your Lookup field in the Access tables back to Text so they'll match the text type on the ASP page.

    Without seeing any of your code and table structure, it's very difficult to offer any more suggestions.

    Hope this helps

  3. #3
    Lounger
    Join Date
    Aug 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Frontpage ASP to Access DB Type Mismatch (2002)

    That was is. Thanks! You were very helpful.

    K

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •