If you can create the SQL Connections in the Control Panel, you should be abe to create them using KiX. When you do the test setup in the Control Panel, can you do the "test connection"? Tempdb is a special database, and you may need to be an Admin to get there.
BTW, you are doing it wrong - you need to call up the function this way:
Code:
ODBCSQL('Tempdb ODBC SVRDB4','SVRDB4','tempdb')
So...
The whole thing looks like:
Code:
; -- Create the ODBC Connector
ODBCSQL('Tempdb ODBC SVRDB4','SVRDB4','tempdb')
; -- Leave the function as is
FUNCTION ODBCSQL($NAME,$SERVER,$DB,optional $user)
DIM $reg,$Title,$Driver,$RegEd,$RegEdPath,$RC
IF NOT $user
$reg='HKLM' ; System DSN
ELSE
$reg='HKCU' ; User DSN
ENDIF
$Title='SQL Server'
$Driver=READVALUE('HKLM\SOFTWARE\ODBC\ODBCINST.INI\'+$Title,'Driver')
$RegEd=$reg+'\SOFTWARE\ODBC\ODBC.INI'
$RegEdPath=$RegEd+'\'+$Name
IF NOT KEYEXIST($RegEdPath)
$RC=ADDKEY($RegEdPath)
$RC=WRITEVALUE($RegEdPath,'Database',$DB,'REG_SZ')
$RC=WRITEVALUE($RegEdPath,'Driver',$Driver,'REG_SZ')
$RC=WRITEVALUE($RegEdPath,'LastUser',@USERID,'REG_SZ')
$RC=WRITEVALUE($RegEdPath,'Server',$Server,'REG_SZ')
$RC=WRITEVALUE($RegEdPath,'Trusted_Connection','Yes','REG_SZ')
$RC=WRITEVALUE($RegEd+'\ODBC Data Sources',$Name,$Title,'REG_SZ')
ENDIF
ENDFUNCTION
Kent