2008-02-29

Microsoft Access Export Truncates Numbers

Introduction

I wanted to export all tables from an Access database into a folder of CSV formatted text files. For most data types, such as Text or Integer, all data was exported without any loss. However, floating point numbers (Float or Double) were exported with only two decimal places.

Approach

You can export a Microsoft Access table to a text file using either the menu item File / Export or this Access SQL statement from KB208408

SELECT * INTO [Text;FMT=Delimited;HDR=Yes;Database=<Path>].[<Table>.csv] FROM <Table>

Solutions

Here's three solutions with varying advantages:

  • KB153364 article suggests formatting the number column to define the required decimal places. This solution requires writing a SQL statement for each table you're exporting.
  • You can add a schema.ini into the destination export folder and specify the number of decimal places for all floating point numbers in a table using the NumberDigits keyword. This solution requires creating or copying a schema.ini file into the export directory before exporting the tables.
  • You can change the No. of digits after decimal in your Regional and Language Options of your computer. This solution means you or your user has to remember to the change that setting on their computer before exporting the tables.

About Schema.ini File

A slight digression: schema.ini is a file used by the Text Driver to determine the characteristics of tables and columns of a database. You can find the syntax and properties of the schema.ini file in Schema.ini File (Text File Driver).

When exporting tables, Access creates a schema.ini file in the export folder if that file does not exist. If there is an existing schema.ini file and the section for the output CSV file does not exist, Access will add a new section for the output CSV file. Otherwise, Access does not change the schema.ini file.

Conclusion

None of the solutions are very satisfactory for writing a general program to export tables from an Access database into a folder of text files. The simplest solution is to define the required number of decimal places in the database connection string (the part between the square brackets in the SQL statement). However, I couldn't find any formal specification of this string on the Web.

2008-02-26

Edit Base Calendar in Project 2000

How to edit a base calendar in Microsoft Project 2000:

  1. Ensure that no or all rows in the Resource Sheet are selected.
  2. Select menu item Tools / Change Working Time.
  3. In Change Working Time dialog, select the required calendar from the drop down list, then edit the calendar.

Note that if some rows are selected in the Resource Sheet is selected, you can only change the calendar for the first resource in the selection, not a base calendar.

2008-02-19

Hide Recycle Bin in Windows Desktop

While noodling around Windows' Group Policy Editor, I noticed that you can hide the Recycle Bin in the desktop:

  1. Start Group Policy Editor using gpedit.msc.
  2. Select User Configuration / Administrative Templates / Desktop.
  3. Select Remove Recycle Bin icon from desktop.
  4. Select Enabled radio button.

Note that Windows' Group Policy Editor is generally used to turn off features, so enabling a setting generally means to disable a function.

2008-02-16

OpenGL for ATI Mobility Radeon in Vista

This is way annoying. I installed an OpenGL game on my Asus notebook and it ran abysmally. When I tried to test the OpenGL interface with glview, that program crashed. The ATI's Catalyst Control Center (CCC) reported that OpenGL Version was Not available.

It turns out that I have to update the driver for my notebook's ATI Mobility Radeon X1700 card and enable OpenGL support. ATI does not support any Mobility Radeon cards but I found an updated driver on the Asus site. Then I used Mobility Modder tool and it enabled OpenGL. Now my system has OpenGL version 6.14.10.7275 and glview runs to completion.

Whew! Thank goodness Mobility Modder worked since I wasn't looking forward to hacking .INF files without knowing anything about configuring video adapters.