Jump to content


Photo

Export data dictionary?


  • Please log in to reply
2 replies to this topic

#1 johnay

johnay

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts

Posted 30 September 2005 - 06:45 AM

I'm writing a (mostly) simple program to compare our shopping cart product database with MOM's stock table and produce a file containing records of new items to be imported into MOM's stock table.

The not-so-simple parts:

1. Read in the stock table. - After a false start with ODBC (never used it with VB5 before - who knew linking to a simple table would be so danged complicated?) I resorted to reading in from a comma-delimited copy exported by dbuwin. I was going to use a "standard" format export, but the comma-delimited version has sufficient clues in the formatting to tell the data types & the decimal places on the numeric fields.

2. Exclude & report non-trivial products that require size/color, kits, etc. - Not clearly flagged in the shopping cart database, but I can detect suspect items through cues in the names & other data. Both rejected & accepted new items will be presented for approval by the operator.

3. Assembling the importable file. - The MOM stock table has 120 columns (one of which, CUSTOMTEXT, was left out in the help file, with some of its attributes attributed to the field before: NEEDCUSTOM which is actually Logical) and I can't find a way to export a list of field names & attributes. I need that to be able to plug data in where it belongs without hard coding that would have to be maintained if the data structure changes.

My question is whether anyone knows a way to easily export a list of field names & attributes from a table. If there's no easy way, I'll just have to make my own table. I think I may need to do that anyway to establish default values for everything, but I'd like the program to be able to easily adapt if the data structure in the table is changed later on.

Thanks!

#2 notehead

notehead

    Advanced Member

  • Members
  • PipPipPip
  • 52 posts

Posted 20 October 2005 - 06:44 AM

You don't say what tools you're using. With MS Access and ODBC you can link the table. ODBC by the way, works just fine both on the outbound and inbound data. Inbound is a little trickier in that you need to make sure that the indexes are fine and that you identify the right key feilds.

You can then do an unmatched query to produce your list.

In Access you can look at the various feilds and see thier datatypes et all.

n

#3 johnay

johnay

    Advanced Member

  • Members
  • PipPipPip
  • 92 posts

Posted 20 October 2005 - 07:47 AM

I think I followed up on this in another thread. I ended up just making my own table of field names, types, & default values.

It all worked pretty well. I have run into one issue with my choice of one default: requiring everything to be weighed. I don't think now that it's necessary to have MOM enforce that, and even if it were I think there's a global option for it anyway. I'll have to redo the import for that, but that's what these test phases are for.

Next hurdle: email sans Outlook. (Anyone know of a free Outlook API wrapper for SMTP? :) )




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users