#113828 - 2004-02-11 07:38 PM
Problem updating fields
|
Chaguito
Getting the hang of it
Registered: 2002-05-17
Posts: 53
|
Hello all....I have a script that writes to an access db and everytime it runs it duplicates the data. Any way to instead of duplicating or deleting the field, update it...
Here is the script...inputs are welcome!!!! 
Code:
; Call Database.udf which contains ; DBConnOpen() ; DBConnClose() ; DBCommand() ; DBExecuteSQL() ; DBGetRecordset() ; DBRecordsetOpen() ; DBRecordsetClose()
If Exist("database.udf") = 1 call database.udf Else ? "database.udf not found. Aborting..." Sleep 3 goto end Endif
$objConn = DBConnOpen('DRIVER={Microsoft Access Driver (*.mdb)}; UID=; PWD=; DBQ=c:\test.mdb')
:ComputerInfo
$SQL1="INSERT INTO COMPUTERS VALUES ('@WKSTA','@USERID','@PRIV','@DOMAIN','@PRODUCTTYPE','@CSD','@IPADDRESS0','@ADDRESS');" $execute=DBCommand($objConn,$SQL1)
:UserInfo
$SQL2="INSERT INTO Users VALUES ('@USERID','@FULLNAME','@MAXPWAGE','@WKSTA','@LSERVER');" $execute=DBCommand($objConn,$SQL2)
:HardwareInfo
$memory=MEMORYSIZE()
$SQL3="INSERT INTO Hardware VALUES ('@WKSTA','$memory','@CPU','@MHz');" $execute=DBCommand($objConn,$SQL3)
:END ? Exit
_________________________
Chaguito, MCP
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Allen)
and 781 anonymous users online.
|
|
|