Results 1 to 2 of 2

Thread: Field definitions

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    81

    Lightbulb

    Hullo once again! I'm accessing a SQL7 database...so far so good. I'd like to validate everything my users try to input before I attempt to update the database. Unfortunately, the fields in the tables can change slightly from time to time (like SmallInt -> Integer, VarChar(200) -> VarChar(500), etc.). Rather than hard-coding each field's definitions, is there a way of getting this info from the DB? And (roughly) how do I use it?

    TIA,
    Toot
    Some cause happiness wherever they go; others, whenever they go.

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696
    Hi Toot you can use the two following pieces of code to get the datatype and size of a field from a recordset

    objDbRs.Fields("Fieldname").DataFormat
    objDbRs.Fields("Fieldname").DefinedSize

    Hope this helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

Posting Permissions

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



Click Here to Expand Forum to Full Width