2006-10-31

Perl: Read ODBC data src (Win32)

use Win32::ODBC;

$Data = new Win32::ODBC("DSN=XXX;UID=YYY;PWD=ZZZ;");
die "can't open data source: $!" unless defined($Data);

$Data->Sql("SELECT a,b FROM sometable;");

print "a;b\n";

while( $Data->FetchRow())
{
    print $Data->Data("a") . ";" . $Data->Data("b") . "\n";
}

$Data->Close();

2006-10-17

Another IE gotcha

When including script files, do:

<script></script>

..instead of:

<script/>

Otherwise IE will render a blank page, only background is visible. "..feature applies to IE6 SP2 and IE7 Betas. IE6 SP1 and earlier are unaffected." (see link post).

2006-10-06

Sarissa: XML parsing (take 2)

Use the .getText() method goddamnit! Bit of a glitch there earlier.. Parsing and then (re-)serializing does not make that much sense in retrospect. 8-]

var oDomDoc = Sarissa.getDomDocument( );
oDomDoc = ( new DOMParser()).parseFromString( responseText, "text/xml");
if( oDomDoc.parseError != 0)
  {
    alert( "Virhe. Palvelin lähetti epäkelvon vastauksen. (parse error)");
    critical( );
  }

oDomDoc.setProperty( "SelectionLanguage", "XPath");
var oElem = oDomDoc.selectSingleNode( "//@some_attribute");

var str =Sarissa.getText( oElem);

...