the telnet sessions are don thru shell windows that are com accessable so as far as true telnet i cant offer much help
I use javascript executed via COM_ScriptControl to interact with odbc you can find many examples
Code:
sCode=
(
var strConnection = "Data Source=HYDRA;User Id=%A_UserName%;Password=%pass%;";
var param1="%param1%";
var param2="%param2%";
var param3="%param3%";
var ErrorLevel=false;
var conn = new ActiveXObject("ADODB.Connection");
var rs = new ActiveXObject("ADODB.Recordset");
connect();
result = exec_query(param1, param2, param3);
close_conn();
function connect(){
try{
conn.open(strConnection, "", "");
}//end try
catch(e){
ErrorLevel="Couldn't connect error: " + e.description;
}//end catch
}//end function
function close_conn(){
try{
conn.close();
}//end try
catch(e){
//do nothing
}//end catch
}//end function
function exec_query(param1, param2, param3){
var query="sql statement"
try{
rs.open(query, conn);
}
catch(e){
ErrorLevel="Couldn't Query error: " + e.description;
// this js error would need to be handled
}//end catch
if(!rs.bof) {
rs.MoveFirst();
var results="";
while(!rs.eof) { results+=rs.fields("feild_name").value; rs.MoveNext();
}
rs.close();
return results;
}//end function
result=result+"";
)
If InStr(r:=COM_ScriptControl(sCode, "JScript", 1),"Couldn't connect error:")
;;some action in ahk
;~ r will be the result of the function
Obviously the above is more demonstration and isnt working code one could do this with com and ahk but havent had a need to convert it
setting up an oracle connection in odbc uses the following ahk
Code:
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,Driver,C:\WINNT\system32\msorcl32.dll
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,DSN,hydra
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,Description,
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,UID,username here
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,PWD,
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,SERVER,db.table
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,BufferSize,65535
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,SynonymColumns,1
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,Remarks,0
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,StdDayOfWeek,1
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,GuessTheColDef,0
RegWrite,REG_SZ,HKLM,SOFTWARE\ODBC\ODBC.INI\hydra,StripTrailingZero,0
same disclamer better edit the red before using
Yes you can also do with php
Code:
<?
@$odbccnx = odbc_connect("connectiondsn","usernames","password");
$query = "sql";
$result = odbc_exec($odbccnx,$query);
//opend the file
$the_file = "output.csv";
$fh = fopen($the_file, 'w') or die("can't open file");
while ($data[] = odbc_fetch_array($result));
odbc_free_result($result);
foreach($data as $value){
if(!empty($value)){
fwrite($fh, $value["feildname"]."\r\n");
}//end if
}//end foreach
unset($data);
fclose($fh); ?>
dont seel yourself short any one who uses ahk in an enterprise endeavor successfully small or big is pitting earning potential against failure. this isnt the work of idiots so if your suing it in your livelyhood you have earned your rights
