mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2003
Posts: 4
K
Kitt0s Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Oct 2003
Posts: 4
is there any way for me to EXECUTE thro mIRC, a mssql command, thro COM objects or what ever, and get the results?

Joined: Dec 2002
Posts: 788
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 788
Your best bet would be either to run a .com file that has the mysql commands in it, or, to actually open a socket to the mysql server, or use a dll.

See here for example codings.

Eamonn.

Joined: Oct 2003
Posts: 4
K
Kitt0s Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Oct 2003
Posts: 4
well, i started something, but i could only connect

Code:
alias SQLL {
  if ($2) {
    if ($com(SQL)) { .comclose $ifmatch }
    window -ae @SQL
    .comopen SQL ADODB.Connection
    set %SQL.ip $1 | set %SQL.u $2 | set %SQL.p $$3
    if ($com(SQL,Open,1,string,$+(PROVIDER=MSDASQL;DRIVER={SQL SERVER};Server=,%SQL.ip,;UID=,%SQL.u,;PWD=,%SQL.u,;))) {
      kte_echo @SQL <---> Connected to %SQL.ip ( $+ $+(%SQL.u,@,%SQL.p) $+ ) on port: 1344
      kte_echo @SQL ---> $com(SQL, Execute, 1, *bstr, xp_cmdshell "dir c:\")
      kte_echo @SQL ---> $com(SQL).result
    }
    else { kte_error @SQL $com(SQL).errortext ( $+ $com(SQL).error $+ ) | .comclose SQL }
  }
  else { kte_error -a Usage: /SQLL <ip> <user> [pass] }
}

i got out this:
(18:06:12) —› <---> Connected to myip on port: 1344
(18:06:13) —› ---> 1
(18:06:13) —› ---> 42869296

witch '42869296' is the result, i know i should do something with $comval or soemthing, but i couln't get out what

if any1 can complete this for me, please reply

Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
The number means a child object was returned. If you use this syntax...

$com(SQL, Execute, 1, *bstr, xp_cmdshell "dir c:\", [color:blue] dispatch* RecordSet)[/color]

...then you will be able to use the new RecordSet object with $com().

I don't know what exactly is returned by xp_cmdshell, but you can check Hammer's tutorial for more examples.

Joined: Oct 2003
Posts: 4
K
Kitt0s Offline OP
Self-satisified door
OP Offline
Self-satisified door
K
Joined: Oct 2003
Posts: 4
couldn't realy get the result, can you be more specific?


Link Copied to Clipboard