Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Rebol and Firebird
Pages: [1] 2 Print
Author Topic: Rebol and Firebird  (Read 3078 times)
donwaters
Newbie
*
Offline Offline

Posts: 4


View Profile
Rebol and Firebird
« on: June 19, 2006, 05:20:48 PM »

I know that we have an ODBC capability that can be used with a Firebird database. Is there anyone who has a native driver available or can it be written in Rebol much like the MySQL native driver has been? I need to create some connections between an ERP system based on Firebird and some web databases in My SQL to move data bidirectionally for a number of clients. Rebol looks like a good tool, albeit a bit obscure. I still have an EDI mapper running at a client that I wrote on a 4GL in the 80s based on a really old tool called Metafile written in Assembler! The thing still works and is one of the most reliable pieces of software I have seen for what it does. Hopefully Rebol can fill that bill as reliably and I would not have to do this in ROR or Python.
Logged
rebolek
Newbie
*
Offline Offline

Posts: 17


View Profile
Re: Rebol and Firebird
« Reply #1 on: June 20, 2006, 02:30:39 AM »

You should contact Graham, his EMR uses Firebird (I don't know the details).

See http://www.compkarori.com/emr/index.html
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: Rebol and Firebird
« Reply #2 on: June 20, 2006, 05:11:27 AM »

The firebird/interbase protocol is undocumented, but it could be done if there were a developer who were willing to try and reverse engineer it from the various firebird open sources as like mysql, it uses tcp.

When I last asked about some documentation for this on the firebird list, they told me to just use the odbc driver which I do.

But of course you will need R/Command if you want to use ODBC ... or one of the hacks around it.
Logged

Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: Rebol and Firebird
« Reply #3 on: June 21, 2006, 01:29:04 PM »

Hi!

Speaking of REBOL and Firebird, I'm trying to connect to a database with a user supplied username & password via a DSN-less connection. The code so far, is as follows (please don't mind the extra variables, I'm still in the experimental stage  :huh:):

Code:
REBOL[]

prin "Login: " login: input
prin "Password: " password: input/hide

cmd-str: {
  dbase: open [
    scheme: 'odbc
    target: rejoin [
      {DRIVER=Firebird/Interbase(r) driver;}
      {Database=d:\data\thesis\proto\employee.fdb;}
      {Uid= :login;}
      {Pwd= :password }
    ]
  ]
}

And to verify if I have the correct cmd-str, I issue a

Code:
print cmd-str 

And of course, instead of the input values for :login and :password, I get the literal strings ":login" and ":password" as part of cmd-str.

My question is how should cmd-str be "defined" so as to get the correct string values. I've tried using reduce, but my limited knowldege and experience with it made my head spin all the more.

Thank you for your response.


@Graham,

Could you share a link or two to the ODBC hacks you mentioned? That seems interesting; very, very interesting. Cheesy
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: Rebol and Firebird
« Reply #4 on: June 21, 2006, 11:43:07 PM »

Since everything is enclosed in a {}, it will all be treated as a string series.

you need to :

cmdstring: to-string rejoin [
  ... {UID=} login {;Pwd=} password ...

]

I was talking about the odbc socket server .. there's an article on the rebolfrance site, but if you have command you don't need it.
Logged

Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: Rebol and Firebird
« Reply #5 on: June 22, 2006, 11:24:49 AM »

Graham,

Thanks for the tip. I've rewritten the code so it makes more sense to me, like so:

Code:
REBOL[]

prin "Login: " login: input
prin "Password: " password: input/hide

t: rejoin [
      {DRIVER=Firebird/Interbase(r) driver; }
      {Database=d:\data\thesis\proto\employee.fdb; }
      {Uid=} :login {; }
      {Pwd=} :password {}
    ]

cmd-str: {
  dbase: open [
    scheme: 'odbc
    target: :t
    ]
}

and by doing a

Code:
do cmd-str

I'm able to finally connect to the database.

Thank you also for the tip about the ODBC socket server. Now if someone would be so kind enough to translate the documentation to English...  ^_^
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: Rebol and Firebird
« Reply #6 on: June 23, 2006, 03:08:36 AM »

Anton has translated it ... it's on his web site somewhere ...
Logged

Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: Rebol and Firebird
« Reply #7 on: June 27, 2006, 12:40:44 PM »

Thanks again. Could someone please post Anton's URL? I've tried the lexicon.net site (the URL I've seen on some of posts from Anton), but I get redirected and the redirected site doesn't have Anton's pages. The redirect is to an Australian ISP if I'm not mistaken.

Cheers!
Logged
donwaters
Newbie
*
Offline Offline

Posts: 4


View Profile
Re: Rebol and Firebird
« Reply #8 on: June 28, 2006, 09:52:54 PM »

Thank you rebolek, Graham and Thor. I will second that request for a URL for Anton, I had the same issue as Thor on getting bounced to a non-relative website. -_-
Logged
Anton
Jr. Member
**
Offline Offline

Posts: 66

Rebol veteran


View Profile WWW
Re: Rebol and Firebird
« Reply #9 on: June 30, 2006, 11:57:55 PM »

I've just uploaded it here:
http://home.wilddsl.net.au/anton/rebol/doc/translated/AccessODBC/odbcsockserv_english.html

I'm also in the middle of translating a DispHelper C code example which uses ActiveX Data Objects to read and manipulate data from a data source to COMLib, mine and Benjamin's COM wrapper for Rebol. So don't know if that will help. Here's a code snippet.

   ; Connect to the data source
   CallMethod [conn ".Open(%s)" {Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Whales.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1;"}]
Logged
Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: Rebol and Firebird
« Reply #10 on: July 02, 2006, 11:35:47 AM »

Anton,

Thank you very much for the link. As for the DispHelper translation, at this point I don't know how exactly it will help, but it'll be of help, in more ways than one. Cheesy

Thanks again and please keep up the great work. Cheers!

Logged
donwaters
Newbie
*
Offline Offline

Posts: 4


View Profile
Re: Rebol and Firebird
« Reply #11 on: July 02, 2006, 03:39:05 PM »

Anton,

I too want to thank you for this info. This will get me a good start on working with Firebird via ODBC. I still have a thought (after getting far more familiar with Rebol) of writing a Firebird driver much like the MySQL driver written by Dockimbel. First I have to forget what I have learned in other languages like Delphi so that I can move forward with Rebol. Is there any tentative date being kicked around on the Rebol V3.0 alpha release?
Logged
Graham
Full Member
***
Offline Offline

Posts: 113


View Profile
Re: Rebol and Firebird
« Reply #12 on: July 02, 2006, 11:16:11 PM »

The tentative release date for R3 alpha is long past ....
Logged

donwaters
Newbie
*
Offline Offline

Posts: 4


View Profile
Re: Rebol and Firebird
« Reply #13 on: July 05, 2006, 01:15:59 PM »

 :huh: And so I would suspect that Carl is no longer talking about release dates? I have tried to contact him directly but not yet gotten any response. I know that he was planning on traveling to Europe at the end of June. Perhaps he is still away?
Logged
Thør
Newbie
*
Offline Offline

Posts: 46


View Profile
Re: Rebol and Firebird
« Reply #14 on: July 10, 2006, 05:27:19 PM »

I've just uploaded it here:
http://home.wilddsl.net.au/anton/rebol/doc/translated/AccessODBC/odbcsockserv_english.html

I'm also in the middle of translating a DispHelper C code example which uses ActiveX Data Objects to read and manipulate data from a data source to COMLib, mine and Benjamin's COM wrapper for Rebol. So don't know if that will help. Here's a code snippet.

   ; Connect to the data source
   CallMethod [conn ".Open(%s)" {Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Whales.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1;"}]



Anton,

Is the REBOL script at the lower part of the translated script the complete OdbcSocketServer-scheme.r file? I wanted to look at it, but I get a 404 error. Could you please post a link to the complete script file? Thanks.



Logged
Pages: [1] 2 Print 
Rebol Talk Forum  |  Getting Started  |  Newbie Help  |  Topic: Rebol and Firebird
Jump to:  

  
Quick Search...

Advanced search
  
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 21, 2008, 06:56:06 PM
Username: Password: Session Length:
  

News: 01-09-08

Alpha version of REBOL 3 has been released!


  
2295 Posts in 593 Topics by 3760 Members
Latest Member: Qndlpkkq

  Rebol Talk Forum | Powered by SMF 1.0.9.
© 2001-2005, Lewis Media. All Rights Reserved.

RT design by Defiant Pc