Monday, August 30, 2004

CSV Documentation

No comments:
For creating data feeds from products in an ecommerce store, CSV is the de facto standard that all the services use. However, the exact rules for CSV are only well documented in one spot that I found: here.

Wednesday, August 18, 2004

FileMaker via ActiveX in C#

No comments:

I had trouble finding documentation about Automating FileMaker from C# (using FM Developer 6), so I’ve written up some of my notes…

First, you have to “add reference”, going to the COM tab and selecting the FM type library. Hit the “Select” button, and then hit OK.

Add a “using FMPRO50Lib;” clause to the beginning of the file where you will be using FM Automation.

Here is the basic code to call a script in the active DB.

ApplicationClass fmApp = new ApplicationClass();
IFMIDocuments fmDocs = (IFMIDocuments) fmApp.Documents;
IFMIDocument fmDoc = (IFMIDocument)fmDocs.Active;
string strScriptName = "ReturnToApprovalRec";
fmDoc.DoFMScript (ref strScriptName);

To find a particular document, you will want to loop the open documents. NOTE: The name shown in the message box is the FULL PATH - you will have to dig the DB name out of there.

IEnumerator myEnum = fmDocs.GetEnumerator ();
while (myEnum.MoveNext ()) {
IFMIDocument myDoc = (IFMIDocument) myEnum.Current;
MessageBox.Show (myDoc.FullName);
}

To open a new DB, you would want to use IFMIDocuments.Open

There are not many things that you can automate (see the object browser), but at least the above outlines the things that CAN be done.

------------------------

Notes for 64 bit machines

There are a number of things that you have to be aware of when using FileMaker on a 64 bit machine

  • Filemaker help cannot be accessed until you install WinHlp32.exe. See http://www.microsoft.com/downloads/d...displaylang=en
  • The FileMaker ODBC driver setup must be done in a somewhat strange way. I found the solution here: http://postgresqldbnews.blogspot.com/2008/03/32-bit-odbc-drivers-in-vista-64.html. Short version: there are two versions of odbcad32.exe in the windows directory. Look for the version inside the syswow64 directory, and use that to set up 32 bit ODBC drivers.
  • AmImEx must be compiled in 32 bit mode for it to be able to access the FM ODBC driver
  • In Windows 7, I had the experience that the COM component for FileMaker was not installed even after FileMaker installed successfully. To fix this, search from "cmd.exe" in the start menu, right click on it and execute as administrator, cd (change directory) to the directory where FileMaker is installed, and execute
    "NameOfFilemaker.exe" /REGSERVER

Tuesday, August 17, 2004

HTML Link-Button

No comments:
To create an HTML button which is actually a link rather than a form submit, put the following OUTSIDE of a form area. <input type="submit" value="Checkout Now" class="button" onClick="document.location=’http://whatever’"></input>

MySQL Freeing Space

2 comments:
When you delete records in MySQL, the table is not compressed - the space is left free for future inserts. In order to see how much “claimed by not used” space you have, use “Show Table Status” (e.g. “show table status from jssdatabase), and check the “Data_free” column. To “compress” the DB, use “Optimize Table” (e.g. “optimize table jss_carts").

Monday, August 09, 2004

XP Woes

No comments:
I wasted beaucoup time over the last month with my XP Professional explorer “hanging” for minutes at a time. This happened in two main situations: when hitting the start menu key, and when right clicking on a folder. A google post finally tipped me off to the problem - the PGP service. Deinstalling PGP fixed the problem immediatly. Note sure if it was a free version I was using, but I saw on deinstall that the version number was 8.0.3.
NOTE: Upgrading to 8.1 fixed the problem. There are rumors (even though the source code for the 8.x version is published) that there are back doors in PGP for the government, but this appears to be only rumors. Phil Zimmerman (creator of PGP) says that all versions prior to 7.03 were free of back doors, but he does not know about later versions (he left the company).

What is my ip?

No comments:
Not sure what IP you’re connecting to the internet with? Try WhatIsMyIp.

Monday, August 02, 2004

.NET decimal issues

No comments:

so parsing would go like:
double dbl = double.Parse("1234.56″,
System.Globalization.CultureInfo.InvariantCulture);

And when you need to get your string from the double, you can do the
same thing in “reverse”:
string s =
dbl.ToString(System.Globalization.CultureInfo.InvariantCulture);