Jochen:

Here's where I am right now - next step is to update the database through the recordset...


I'm trying to think of a generic application for this stuff - a KIX DB script that might be of general interest to the board and would excerise all the DB functions... any ideas ?

Give this script a try and let me know if it works !

code:

break on


; Everytime this script is run - it updates the
; database and displays the results...


; Create a blank database called logon.mdb
; then set the following variable as required...


$database= "m:\msaccess\logon.mdb"


$dsn= "data source= $database; provider= microsoft.jet.oledb.4.0;"


; Create connection...


$connection= olecreateobject("adodb.connection")


if @error
?"mdac:adodb not insalled on this machine"
quit(0)
endif


; Set the connect string ...


$= oleputproperty($connection,"connectionstring","s","$dsn")


; Open connection ...


$= olecallfunc ($connection,"open")


; Create a table ...


$= olecallfunc($connection,"execute","s",
"create table logon (stamp char(50) primary key, userid char(50))")


; Add a record ...


$= olecallfunc($connection,"execute","s",
"insert into logon (stamp,userid) values ('@time', '@userid')")


; Create a recordset...


$recordset= val("&"+olecallfunc($connection,"execute","s",
"select * from logon"))


; Get the fields...


$fields= val("&"+olegetproperty($recordset,"fields"))
$stamp= val("&"+olecallfunc($fields,"item","s","stamp"))
$userid= val("&"+olecallfunc($fields,"item","s","userid"))


; Enumerate the recordset...


while olegetproperty($recordset,"eof")= "0" and @error= 0


?
?"stamp : " olegetproperty($stamp,"value")
?"userid : " olegetproperty($userid,"value")


; Next record please ...


$= olecallfunc($recordset,"movenext")


loop


?


; Closeup (important!) ...


$= olecallfunc($recordset,"close")
$= olecallfunc($connection,"close")


; Cleanup (not so important!) ...


$= olereleaseobject($stamp)
$= olereleaseobject($userid)
$= olereleaseobject($fields)
$= olereleaseobject($recordset)
$= olereleaseobject($connection)


exit


Shawn.

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