|
Pages: [1] 2
|
 |
|
Author
|
Topic: Rebol and Firebird (Read 3076 times)
|
|
donwaters
|
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
|
|
|
|
|
|
|
Graham
|
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
|
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:): 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 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. 
|
|
|
|
|
Logged
|
|
|
|
|
Graham
|
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
|
Graham, Thanks for the tip. I've rewritten the code so it makes more sense to me, like so: 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 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
|
Anton has translated it ... it's on his web site somewhere ...
|
|
|
|
|
Logged
|
|
|
|
|
Thør
|
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
|
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
|
I've just uploaded it here: http://home.wilddsl.net.au/anton/rebol/doc/translated/AccessODBC/odbcsockserv_english.htmlI'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
|
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.  Thanks again and please keep up the great work. Cheers!
|
|
|
|
|
Logged
|
|
|
|
|
donwaters
|
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
|
The tentative release date for R3 alpha is long past ....
|
|
|
|
|
Logged
|
|
|
|
|
donwaters
|
: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
|
I've just uploaded it here: http://home.wilddsl.net.au/anton/rebol/doc/translated/AccessODBC/odbcsockserv_english.htmlI'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
|
|
|
 |
News: 01-09-08 Alpha version of REBOL 3 has been released!
2295 Posts in 593 Topics by 3754 Members
Latest Member: MPShetfoept
|