[REBOL] q's regarding reb Re:(2)

2000-06-06 Thread Galt_Barber




 -galt

 p.s. I was so desperate to use Rebol that I hacked port 1433 to get into MS
 SQLServer 7.
Wassat?! Howd u do dat? And what did u achieve? :)
Brett.

Well, I posted the code for it but got no response whatsoever.
I assumed everybody had no interest in MSSql7.

Basically, to the best of my knowlegde, MS has not documented
the protocol they use, but you can figure most of it out for yourself,
with some effort.
This is the protocol that their odbc driver on the client uses
to communicate with the server.  It speaks MS's brand of SQL,
which is standard enough for most purposes.

The way I began hacking it was to set up a rebol program as a proxy that sat
on some other port -- 9005 is what I used from some tcp example code  --
and then used the client utility that came with sql7 to create a profile
that used 9005 instead of the usual 1433.  MS provides this ability to redirect
to another port mainly to support getting around firewall servers and things
like that.

In any case, with a marvelous tcp-friendly tool like Rebol it wasn't
long before I had my program sitting in the middle between the client
on 9005 and SQL7 on 1433, as a proxy, watching the traffic and logging
it.  From there, it's basically just a process of dissecting the stream
into meaningful bits.  It wasn't particularly meant to be human-readable,
but it was not too bad.  If MS had encrypted the stream or something that
would have made it much harder.

I also just learned enough to process the kinds of requests that I
would make in my app.  You could probably equally well figure out
any that I did not need to address.  Largely I was logging on, changing the
default db to access, doing various select statments, some create/drop table
statements, some insert/delete/set/select into stuff for updating, and most
of the data types I was working with were strings, although there were a
couple of numbers and dates, plus I had to deal with memos, which are
apparently always Unicode, and tables imported from MSAccess, which
are also always in Unicode (2 byte/char).

I also found out how to cancel a query that you are waiting for.
If you start a bad query that will run forever, you must send the server
a query-cancel on the connection, or else the stupid thing will keep
on running, and tying up one of its licenses.  I have a puny 15 or so,
so eventually I ran out while debugging one day.  Then I went back
to the proxy to watch what happens when you start and then cancel a query.

In any case, this is sufficient to get any version of Rebol connected today
to MSSqlServer7.

 As a security note, tools like Rebol are going to make
lazy administrators really sorry that they left in the "sa" user with no
password,
which is the default.  You can just walk right up to the port and say, Gimme.
I haven't tried it, but I imagine it would work.

There is also one thing that is a little less than clean about the login
request.
It is one of the most complex requests and it was also the first one I had to
overcome,
so I actually just store the entire request while in proxy mode to a file, and
then use
it later to connect by spitting the whole thing at the server.  It works.  I
don't even
break it down into which bit means which.   Since for my application it didn't
matter,
I didn't have to worry about that.  After working with so many other bits of the
stream, I could probably make pretty good guesses about it's structure now,
but I haven't bothered.  The two elements of the login request that you might
want to
change are the login and password.  I think that they try to hide the password
so it's not
passed in clear text in the stream, but I doubt it's super hard to figure out
what the pattern is.  I never needed to, as this program is just for an internal
process, and is not going to be installed at any customer site.

I would have rather used ODBC, but it wasn't available.  I am happy to say that
Rebol still came through for me and with a few days' effort was able to connect
to MSSql7 and do everything I needed.  Rebol is much better than VB for most
things,
and with /View now becoming available I may be able to do most of my
programming in Rebol from now on.  Wouldn't that be marvelous!

-galt

p.s.
I could re-post the code if people are interested.
I would have to chop out most of the actual app and
just leave the generic bits that are about talking to MSSql7
and decoding it's response.







[REBOL] q's regarding reb Re:(2)

2000-06-05 Thread bhandley

I really really hope that is the case. I've been thinking how Rebol/View is
so well designed to create a whole new kind of programming - polished
user-specific (i.e one-off) sent via email, etc. for support or specific
"rich email app" functionality.

Brett.

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 06, 2000 8:12 AM
Subject: [REBOL] q's regarding reb Re:




 [EMAIL PROTECTED] wrote:

   /View is very exciting!!
 
  Carl,
 
  Do we have a hint yet how much it is going to cost?

 Surprise, surprise, AFAI /View's supposed to be completly free :-)

 -pekr-

 -galt

 
  p.s. I was so desperate to use Rebol that I hacked port 1433 to get into
MS
  SQLServer 7.
  Please don't make me do that again, even though it was fun.





[REBOL] q's regarding reb Re:(2)

2000-06-05 Thread Al . Bri

  Do we have a hint yet how much it is going to cost?
 
 Surprise, surprise, AFAI /View's supposed to be completely free :-)

It's confirmed on the rebol web site too. :-)

Andrew Martin
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
--