Rogier:

There's nothing better than starting the day with a strong cup of coffee and a little bit of kix scripting - eh ?

[it's amazing, coffee and kix scripting just seem to go together like - bacon and eggs - Sonny and Cher - VBS and Virus's]

Try running this script against your database - change the $source to your specifics...

Just want to make sure we're on the "same page" in terms of simply reading the database first...

code:

break on


; Change these to your specifics ...


$source= "data source=\\dn1cov\shawn\msaccess\app.mdb; provider=microsoft.jet.oledb.4.0;"
$table= "app"
$sql= "select appname, commandline, snapname from app;"
$delim= ";"
$cnnobj= "adodb.connection"
$rstobj= "adodb.recordset"


$cnn = olecreateobject ( "$cnnobj" )


if @error
?"Error creating object $cnbobj."
?"@serror"
quit(0)
endif


$= olecallfunc ( $cnn, "open", "s", "$source" )

if @error
?"Error connecting to datasource."
?"@serror"
quit(0)
endif


$rst = olecreateobject ( "$rstobj" )


if @error
?"Error creating object $rstobj."
?"@serror"
quit(0)
endif


$xcnn= dectohex ($cnn)


$= olecallfunc ( $rst, "open", "so", "$sql", "$xcnn" )


if @error
?"Error opening recordset."
?"@serror"
quit(0)
endif


$rec = olecallfunc ( $rst, "GetString", "sss", "2", "1","$delim" )


while @error = 0

; parse out the fields ...

$rec=$rec+"$delim"


$pos= instr("$rec","$delim")
$appname= substr("$rec",1,$pos-1)
$rec= substr($rec,$pos+1,len($rec))


$pos= instr("$rec","$delim")
$commandline= substr("$rec",1,$pos-1)
$rec= substr($rec,$pos+1,len($rec))


$pos= instr("$rec","$delim")
$snapname= substr("$rec",1,$pos-1)
$rec= substr($rec,$pos+1,len($rec))


?
?"AppName: $appname"
?"CommandLine: $commandline"
?"Snapname: $snapname"


$rec = olecallfunc ( $rst, "GetString", "sss", "2", "1", "$delim" )

loop


:finish


; object cleanup ...


if $rst
$rs = olereleaseobject ( $rst )
endif


if $cnn
$rs = olereleaseobject ( $cnn )
endif


exit


Shawn.

[This message has been edited by Shawn (edited 01 December 2000).]