Firebird - Connecting using an IP address lazarus / 16-Databases ---------------------------------------------------------------------- timcs · 2013-06-20 08:54 Hi   I am re-writing a program of mine which used DBF and now trying to use firebird. My first problem I am having is when I try and point the databasename location to the following path using an UNC: \\10.1.1.1\database\data.fdb I get an error when trying to set connect to true which is: fblinks DoInternalConnect:  - Unable to complete network request to host "10.1.1.1"  - Failed to establish a connection Does Firebird not accept IP UNC paths ? I know if I point via the drive instead it does not error Thanks TimCS ---------------------------------------------------------------------- BigChimp · 2013-06-20 09:22 No, it doesn't accept UNC paths. Why should it? http://www.firebirdfaq.org/faq260/ ---------------------------------------------------------------------- timcs · 2013-06-20 09:32 Quote from: BigChimp on June 20, 2013, 11:22:48 amNo, it doesn't accept UNC paths. Why should it? http://www.firebirdfaq.org/faq260/ Thanks BigChimp - I am just trying to mirror how the dbase database worked and as I cannot install firebird so I am using the embed method install. I will give this ago Thanks TimCS ---------------------------------------------------------------------- BigChimp · 2013-06-20 09:36 Then it's different. IIRC, you can use an UNC path, but need to specify it the way that FAQ page says. Also make sure at most one (embedded) Firebird instance is connected to the file. (In other words, if you want to have multiple users accessing the same data it's easier to use the server version) ---------------------------------------------------------------------- timcs · 2013-06-20 10:10 Quote from: BigChimp on June 20, 2013, 11:36:03 amThen it's different. IIRC, you can use an UNC path, but need to specify it the way that FAQ page says. Also make sure at most one (embedded) Firebird instance is connected to the file. (In other words, if you want to have multiple users accessing the same data it's easier to use the server version) I am still getting the error connections if I try any of the suggestions in the FAQ even including the port number, perhaps this is not going to work in my situation. I was hoping to have this as a back up as my current program is not in full use and was concerned over the speed of dbase over firebird. Thanks TimCS ---------------------------------------------------------------------- BigChimp · 2013-06-20 10:48 You don't need a port number when using embedded Firebird. Have you read the wiki? There's an article on Firebird embedded including sample code. ---------------------------------------------------------------------- timcs · 2013-06-20 14:01 Quote from: BigChimp on June 20, 2013, 12:48:22 pmYou don't need a port number when using embedded Firebird. Have you read the wiki? There's an article on Firebird embedded including sample code. I presume you mean this : http://wiki.freepascal.org/Firebird_embedded I did read it but time has passed by since then so I will study it again and make sure I have not missed anything Thanks TimCS ---------------------------------------------------------------------- timcs · 2013-06-21 07:29 In Lazarus when setting the code up to use the embedded files from firebird , if I copy these files into the project area should Lazarus detect that they are there as I am trying to test the databasename connection via Lazarus but keep getting : cannot load default Firebird clients (fbmbed.dll or gds32.dll) check your installation. Any Ideas? Thanks TimCS ---------------------------------------------------------------------- exdatis · 2013-06-21 07:34 http://wiki.freepascal.org/Firebird_embedded But if you use TCP/IP then copy standard dll(s) to the project path, it should work ---------------------------------------------------------------------- timcs · 2013-06-21 07:53 Quote from: exdatis on June 21, 2013, 09:34:11 amhttp://wiki.freepascal.org/Firebird_embedded But if you use TCP/IP then copy standard dll(s) to the project path, it should work Thanks already read this and these are the files in my project area. So I really do not know why it gives this message Thanks TimCS ---------------------------------------------------------------------- exdatis · 2013-06-21 08:02 Sorry, too late I read other posts. I tried from Linux with wine to use a win application and I just copied dll(s) from Firebird(super) server and it worked Regards ---------------------------------------------------------------------- timcs · 2013-06-21 08:14 Quote from: exdatis on June 21, 2013, 10:02:03 amSorry, too late I read other posts. I tried from Linux with wine to use a win application and I just copied dll(s) from Firebird(super) server and it worked Regards That is odd , this is what I have done ( I assume you have just copied these into your project folder) and still getting this message as mentioned before. However if I use these files when running the exe separately the exe does not have this message I am just getting the connection error which is what I am trying to resolve via the Lazarus IDE. Thanks TimCS ---------------------------------------------------------------------- timcs · 2013-06-23 20:14 this problem that I am having, could it be down to either ALL or one of the following: 1) Running Lazarus 1.0RC 2) Running Lazarus from a Pen drive as due to work politics I cannot install it on my work PC 3) the project and data reside on the Pen drive. I have Lazarus 1.0.8 on my home PC and when using the same project on that , I can connect to the database with the same folder copied from the pen drive. the question is, why would it not work from the pen drive? Thanks TimCS ---------------------------------------------------------------------- timcs · 2013-06-24 16:13 Got the Firebird Dlls working by copying them into the lazarus area as well but what is odd, is that I did not have to do this when running it from my machine at home Thanks TimCS ---------------------------------------------------------------------- timcs · 2013-06-24 16:27 Now that I can get the connection to work with firebird Embedded I still need to be able to do the following: Have the Exe and the DLLs for Firebird on each PC that needs the program but access the database over a mapped drive or UNC path. I have tried the connection strings as per the link given by BigChimp but these do not work. Am I trying something that will not work. Thanks TimCS ---------------------------------------------------------------------- taazz · 2013-06-24 16:47 1) you share the client dll only to all the computers that have your program. 2) You install firebird server on one machine on the network. 3) you copy the database in a folder that firebird server has full control 4) You make sure that the firebird port is not blocked on the server. 5) You connect from your client with out using any network drives. Don't confuse an SQL server with a file based database like access, the path to the database is the path as you would define it on the server aka the complete path to the database on the server machine eg D:\FirebirdData\MyDatabase. I use to define an alias in the aliases.conf file that allows me to just a simple name eg MyDatabase instead. ---------------------------------------------------------------------- timcs · 2013-06-25 07:46 Quote from: taazz on June 24, 2013, 06:47:34 pm1) you share the client dll only to all the computers that have your program. 2) You install firebird server on one machine on the network. 3) you copy the database in a folder that firebird server has full control 4) You make sure that the firebird port is not blocked on the server. 5) You connect from your client with out using any network drives. Don't confuse an SQL server with a file based database like access, the path to the database is the path as you would define it on the server aka the complete path to the database on the server machine eg D:\FirebirdData\MyDatabase. I use to define an alias in the aliases.conf file that allows me to just a simple name eg MyDatabase instead. Thanks for the detailed reply Taazz - Problem is, is point 2, I cannot do that. Looks like I will be stuck with the dbase system unless there is another database system I can use that works like dbase in that no server installation is needed. Thanks TimCS ---------------------------------------------------------------------- taazz · 2013-06-25 08:05 The DBase technology has been let to rest around the time that open source SQL servers become to life is a solution ridden with problems and inconsistencies. There is no one supporting that database model except access and that is getting attention only because is part of the MS Office so I do not think you are going to find a non server database to use easily. Personally I do not know any excpet te usual suspects access, DBase and paradox. ---------------------------------------------------------------------- timcs · 2013-06-25 08:22 Quote from: taazz on June 25, 2013, 10:05:13 amThe DBase technology has been let to rest around the time that open source SQL servers become to life is a solution ridden with problems and inconsistencies. There is no one supporting that database model except access and that is getting attention only because is part of the MS Office so I do not think you are going to find a non server database to use easily. Personally I do not know any excpet te usual suspects access, DBase and paradox. I know dbase is now obsolete but because I can access the data this way it seems to be the best. I presume Dbase is quicker than trying a plain text or XML file format as that would be the only other option. Thanks TimCS ---------------------------------------------------------------------- taazz · 2013-06-25 09:07 actually now that I think about it there is one pascal native solution that might help in your case it is a bit old but it was rock solid and highly apprised at its time that is the turbopower B-Tree Filler. As far as I know it has some security build in as well (data security as in lock record for editing etc). That library wend open source when the turbo power company closed down and you can find the code at http://sourceforge.net/projects/tpbtreefiler/?source=directory. I remember that some one had converted to freepascal but I do not remember where I red that commend probably in one of the mailing lists. Let me search my archives and I'll come back to you. EDIT: OK found the announcement on fpc pascal mailling list. here is the mail Quotehello all;  I have converted b-tree filer to work on Free Pascal on Windows Xp and Windows 7. Two of the function do not work, (reorg rekey). I wrote three function that do the same thing, only two are needed I have a demo (part of my program)  the editor and map driver and graphics demo one text editor for the maps.  It will work for 68,719,476,735 keys the demo only has 3,700 records at the moment.  If you want a copy it is ready to download, there is a sub directory named gtest this is my source and compiled code btree code is in the source directory  tpbtreefiler_5_51a  this is written for a wide screen monitor setwindowsize(1920,1080) it will work with smaller screens but some items will be off the screen.  Go to the site below and download turbopower.exe  this is both btree filer and flash filer and their manuals.  you may contact me( Allen Harrington at bluehare@att.net) my website is http://blue-hare.com Let me emphasize this one more time, you and your client will be far better off if you convert today to server based solution like firebird in which case is lightweight and has a lot better security than the model you are already using. ---------------------------------------------------------------------- timcs · 2013-06-25 09:29 Quote from: taazz on June 25, 2013, 11:07:23 amactually now that I think about it there is one pascal native solution that might help in your case it is a bit old but it was rock solid and highly apprised at its time that is the turbopower B-Tree Filler. As far as I know it has some security build in as well (data security as in lock record for editing etc). That library wend open source when the turbo power company closed down and you can find the code at http://sourceforge.net/projects/tpbtreefiler/?source=directory. I remember that some one had converted to freepascal but I do not remember where I red that commend probably in one of the mailing lists. Let me search my archives and I'll come back to you. EDIT: OK found the announcement on fpc pascal mailling list. here is the mail Quotehello all;  I have converted b-tree filer to work on Free Pascal on Windows Xp and Windows 7. Two of the function do not work, (reorg rekey). I wrote three function that do the same thing, only two are needed I have a demo (part of my program)  the editor and map driver and graphics demo one text editor for the maps.  It will work for 68,719,476,735 keys the demo only has 3,700 records at the moment.  If you want a copy it is ready to download, there is a sub directory named gtest this is my source and compiled code btree code is in the source directory  tpbtreefiler_5_51a  this is written for a wide screen monitor setwindowsize(1920,1080) it will work with smaller screens but some items will be off the screen.  Go to the site below and download turbopower.exe  this is both btree filer and flash filer and their manuals.  you may contact me( Allen Harrington at bluehare@att.net) my website is http://blue-hare.com Let me emphasize this one more time, you and your client will be far better off if you convert today to server based solution like firebird in which case is lightweight and has a lot better security than the model you are already using. Taazz I was not expected such another detailed reply!!! This is just a small project I am doing for work and I know that they (as in the engineers) will not allow for firebird to be installed on this server. I am doing this off my own back (not always a good idea) to try and improve a situation we have here when connecting to customer sites. The database simply stores when a user is on a site and then waits for that connection to end to then write to the record when they are off. It also then checks if user(s) are on a site and informs another user who is these are etc. Dbase is the file I use to store this information , at the moment a few of us are using this but at some stage it will be used by around 40 or more users and I am just wondering if it will quick enough when checking for the records. I have put in place a routine that when the first person goes on in the morning it clears the previous days records. Thanks TimCS ---------------------------------------------------------------------- taazz · 2013-06-25 09:41 well there are a lot of solutions to the server problem for example install the server on an other machine instead of the existing tight server eg your computer, as long as the computer is on the same lan as the clients then you are set. Ofcourse if the current implementation with the DBase components that come with FPC covers all your requirements (which I doubt) then I do not see any reason for you to upgrade to an other database. on the other hand b-tree filer has data security and far better search capabilities build in, aka it does not require you to load everything in memory and filters data as you read them from the disk. Now please keep in mind that I haven't touched that technology for a long time and memory can play tricks especial on events that long in the past, you need to evaluate the library your self and see if it gives you any benefit converting or not, you might even learn something new at the same time.