IFS 106 Prof Bill's NotesCreating and Importing DB'sSome insight into create databases from a variety of sources The First StepSo you want to create a new database? The first step each and every time (not most of the time, not some of the time, but every time) is to get a piece of paper and plan out your tables and fields. There is no magic in that computer screen until you know what you're doing. Now once you know what you're doing, then the magic begins. So, for each and every database problem you do... answer the following questions:
Now answering these questions is sometimes difficult, but doing this is what we'll be learning over the course of the, well, course. Importing data? Why?I am focusing on importing data from a variety of sources because I think that it is a common problem that you may run into out there in the cold, cruel world. Data is rarely stored all nice and tidy in Access files. Rather, it's in web pages or text files or whatever. So, I want you to get some experience tackling these issues. Also, don't be fooled by our small file sizes. You may think, "Ah, I could just type this data in and be done with it." Our file sizes are small for "educational" purposes. Many real databases will be much too large to just type the data in. This is where your (nascent) import skills become valuable. The typical caseTypically, importing data into Access will require two steps. First, you'll have to somehow get the data into Access. That's covered for a number of different cases in the following sections. Once your data is in, then you will usually have to do some repair work to complete the task:
Importing a web pageAccess has the really cool and smart ability to find tables in a web page and then try to interpret them as databases.
If a web page has multiple tables in it, then you'll have to import each one separately. Importing a text fileThere are two cases here:
Once your text file is nicely formatted:
Importing a spreadsheetThis case is very similar to importing from a text file. You're only allowed one table per file, though you may be able to import multiple tables if they reside on separate worksheets. In any case, the process is very similar to that for text files:
Importing an XML fileXML is a standard file format on the web, sort of like HTML, but more general. Usually a database stored in XML will actually have two files related to it:
Our text talks about importing XML files on pages 187-190. If your XML is well-defined (with its accompanying XSD schema file, primarily), then things are easy:
Now, if you XML is not well-formed, then you'll have to get in there and pop the hood. It's not hard, but that's probably beyond the scope of our class. If you're interested in something like this, then email me and we'll chat. Importing a Word fileI don't believe that there is a direct path from Word to Access. So what are we to do? You can cut and paste the relevant data from Word to any number of forms that Access does accept, like:
Web pages are probably the least desirable option here. Exporting databasesWe'll talk less about exporting database information because that's usually a pretty automatic thing to do. Our text covers some of this on pages 181-187. We will talk in more depth about creating web pages from Access databases. That is coming soon. thanks... yow, bill |
wtkrieger@noctrl.edu ... william.krieger.faculty.noctrl.edu/ |