I have this script that is driving me crazy! It basically pulls user login data and stores it in an existing SQL server database. The script works perfectly if I use Kixtarter 4.10 IDE with KIX 4.60 (F5, Normal Run) or if I run from command line , but if I use drag/drop to kix32.exe or wkix32.exe it throws an error for a specific line . Maybe this is a bug? The script is uses standard UDFs from this site

Code below:

 Code:
If @LOGONMODE = 1
	; Logon Mode is on
	$SO=SetConsole("HIDE")
	Break OFF
Else
	;Logon Mode is off
	$SO=SetConsole("SHOW")
	Break ON
EndIf	
$SO=SetOption("WrapAtEOL", "ON")
$SO=SetOption("Explicit", "ON")
$SO=SetOption("NoMacrosInStrings", "ON")
$SO=SetOption("NoVarsInStrings", "ON")

DIM $objConn, $retcode, $datastring
DIM $sqlserver, $uid, $uidpwd, $sqldb

;Load necessary UDFs
Call UDF_DBConnOpen.kix ;open DB
Call UDF_DBExecuteSQL.kix ;Execute SQL in DB
Call UDF_DBConnClose.kix ;close DB

; ****** VARIABLE DEFINITIONS ***********

; "Username,Date Time,IP,Computer Name, OS, Type,Domain Controller"

$datastring =  "'" + @TICKS + "','" + @USERID + "','" + @DATE + ' ' + @TIME + "','" + @IPADDRESS0 + "','" + @WKSTA + "','" + @PRODUCTTYPE + "','" +Split(@LDRIVE,'\')[2]+"'"
$sqlserver = "server"
$uid = "uid"
$uidpwd = "password"
$sqldb = "database"

; ****** VARIABLE DEFINITIONS  END ***********

$objConn = DBConnOpen('DRIVER={SQL Server};SERVER='+$sqlserver+';UID='+$uid+';PWD='+$uidpwd+';DATABASE='+$sqldb)
If @ERROR=0
	$retcode = DBExecuteSQL($objConn,"INSERT INTO UserLogs VALUES (" + $datastring + ")")
	If @ERROR <> 0
		? 'Error = '+@ERROR+' - '+@SERROR
	EndIf
EndIf
$retcode = DBConnClose($objConn)

Sleep 10

Exit


The error is :

ERROR: expected ')'!
Script: script.kix
Line: 46

Where line 46 is
 Code:
$retcode = DBExecuteSQL($objConn,"INSERT INTO UserLogs VALUES (" + $datastring + ")")