How to open DBF file in DBeaver with JDBC - jdbc

I'm not sure why I can't connect to .DBF files using DBeaver with the built in JDBC driver for "Flat Tiles (CSV/DBF).
I have a share drive with dozens of DBF files on it. I create the connections as shown in the attached images, but when I connect to the source I have two issues. I've included the steps I follow and the error that I get.
Does anyone have experience connecting to DBF files with JDBC and or using the DBeaver tool that might help me here?
I did download that DANS-DBF library JAR from GitHub but I am not sure how I can use it in this situation. I noticed on this site it says
CsvJdbc requires Java version 1.6, or later. For reading DBF files, DANS DBF Library must be downloaded and included in the CLASSPATH.
But I'm not sure how I can add it to DBeaver projects. They don't use build paths like an actual java project.
(I know I can open them in excel, but I prefer this tool for data queries).
I create the database
I select the build in CSV DBF connection type.
The driver properties only had .CSV I tried it with this setting, and when it didn't work, I changed it to .dbf and it still didn't work
I can connect to this folder fine, and i know there are plenty of DBF files in it.
Settings FYI.
When I try to open the one DBF file that appears I get an error message.

I apologize for breathing life into this year and a half old post but I had the same problem and this was the first link on google.
After much research and fiddling I got DBeaver to open a .dbf flat file using most of the settings you already described.
The CSV/DBF JDBC Driver to open dbf files requires DANS DBF as you mentioned and requires its addition to the CLASS PATH. There was limited information on that process and I have found no easy way to modify that in Dbeaver. I also looked through a few other JDBC that supposedly opened xBASE files such as HXTT but they weren't free which was a deal breaker for my use.
I did however get it to work by placing the DANS DBF jar file in the same directory with the csv JDBC driver. It had no trouble finding it as a dependency and ran like a charm.
So for anyone who is looking to do this.
In DBeaver open the driver manager and select the csv flat file
download the driver if needed.
download DANS DBF from souce forge
http://dans-dbf-lib.sourceforge.net
add that file to the driver and make sure you put it in the same directory as the csvjdbc driver. It should be in your user folder .dbeaver-drivers. if you click the driver file and the information button it should give you the filepath.
Then add the DANS DBF file to the driver manager
Make sure you change the file filter type to .dbf as you did otherwise it will hide all .dbf files.
Make a new connction and you are good to go!
a few things to note. I found that the file type extension is case sensitive so if you filter by .dbf then .DBF will not show up in the connection. A few people commented that the JDBC driver doesn't like spaces in filenames and it is a read only driver with a few quirks.

I ran into this issue recently and wanted to share, if you're still having problems of DBeaver stating it cant find Field or getRecordCount, etc. Serphentelm mentioned following the steps and still getting an error. I found that the JAR file from sourceforge is the source, NOT the compiled .class files.
I had to build the jar myself. For those needing it, I put it here:
http://s000.tinyupload.com/index.php?file_id=59469996816520223299
I placed that in the csvjdbc folder mentioned above, then just did "Add File" from the Edit Driver page in DBeaver to add the jar.

For DBeaver 2.22.1:
download dans-dbf-lib-1.0.0-beta-10.jar (e.g. from sourceforge)
in Drivers location, Local folder (in Windows: C:\Users\user\AppData\Roaming\DBeaverData\drivers) create the \drivers\dbf directory. NB 'drivers' must be created under drivers, so ...\DBeaverData\drivers\drivers\...
put dans-dbf-lib-1.0.0-beta-10.jar in this folder
now you can create a new connection using the Embedded/DBF driver

Related

Migrating an old old old VB + MSAccess program to a different computer

I have an old program that was made for us a looong time ago. It consists of a large MDB (Access) file with all the data (no encryption, I can manually open the file and browse all the data) and an EXE file (probably VB?) that was custom made to easily manage the data in the file.
I'm trying to move this program for another user, to run in his own laptop.
First I tried just copying all the files, but I had MSCOM, GRD, LST, and ocx missing file errors. I tracked them all down and regsvr32'd them, and the program seemed to go a little further.
Then I got an ODBC connector error. Playing with ODBC sources manager and I added an entry with the name of the program that points to the specific MBD file. This helped too.
Now program starts and shows all menus, buttons and everything. However, the default record that should be onscreen is empty and as soon as I hit any control (next record, list, etc...) it crashes with a VB error 91:
Run-time Error '91': Object variable or With block variable not set
So it looks like the program can open the database file itself but it cant really access the data inside.
What else can I try to see what I need to set it all up correctly? Is there anything that "spies" inside and VB program to see how it's trying to access the MDB file?
Any help would be appreciated!
Probable cause of your problem is some missing dll/ocx file referenced in your application. Open your exe file with notepad (or notepad++) and find all occurrences of .dll and .ocx files and check if those
files exist at user's laptop. If not, just copy them from your working machine and regsvr32 them.
I will go with #smith suggestion.
While looking at the error message on microsoft's website, below is the solution that applies to your scenerio
"The object is a valid object, but it wasn't set because the object library in which it is described hasn't been selected in the Add References dialog box."
So ensure all files are correctly copied to new system.

Using IIB File nodes to move, copy, download and rename (S)FTP files without opening them

I am using IIB, and several of the requirements I have are for message flows that can do the following things:
Download a file from an FTP and/or SFTP server to the local file system, with a different name
Rename a file on the local file system
Move and rename a file on the (S)FTP server
Upload a file from the file system to the (S)FTP server, with a different name
Looking at the nodes available (FileInputNode, FileReadNode, FileOutputNode); it appears that they can read and write files in this way; but only by copying them into memory and then physically rewriting the files - rather than just using a copy/move/download-type command, which would never need to open the file in the same way.
I've noticed that there's options to move store files locally once the read is complete, however; so perhaps there's a way around it using that functionality? I don't need to open the files into memory at all - I don't care what's in the files.
Currently I am doing this using a Java Compute Node and Apache Commons Net classes for FTP - but they don't work for SFTP and the workaround seems too complex; so I was wondering if there was a pure IIB way to do it.
There is no native way to do this, but it can be done using Apache Commons VFS

Access DBF from FTP Server

I Have a application on Clipper,DBF.
Is It Possible to access DBF file from FTP Server Using Clipper Program?
Thanks.
No, not really.
FTP is not a "shared folder". You can create a batch file which will download file via FTP, then run your clipper application, then after application finishes copy modified .DBF back to FTP server.
Note however that it will be slow (as you need to transfer whole .DBF file even if you need just a tiny bit of it) and that you MAY NOT use it at more than one place at a time (running it in more than one place will overwrite data, including possibility of file truncation/corruption)
There are utilities that present FTP as a filesystem ("shared folder"), for example curlftpfs, but while it allows you to just run .exe directly instead of via aforementioned .bat file, ALL THE LIMITATIONS mentioned in previous paragraph still apply - it is not possible to avoid them due to nature of FTP.

Making an SQLite ConnectionString portable

As a personal project I want to test the ability of using SQLite with MVC 3 and so far so good managed to get everything setup.
The thing I am now trying to achieve is to make the solution fully portable during development, but I am unable to achieve this as the connection string is complaining that the database is missing if I try on different machines where the solution it located in different places.
Is there any way that I can alter the connection string so it is uses a set directory each and everytime?
I have the database housed in a datalayer solution in the same folder houses my datamodel if that is any help
I see two ways:
Specify the location of the SQLite database as relative to the executable
Make the path specifiable as input (say a command line argument or .config file)

accdb file read only when installed with VS2010 setup project

I have created a program that uses an accdb file. I have also created a setup project for deployment of said program. However, I am having difficulties with the accdb file being ready only in Microsoft Vista.
First I had the accdb file installed into the DataDirectory, but realized that if you need changes made to files the Program Files location is not the place to install files.
SO I attempted to install into the ProgramData directory but the accdb file is still read only.
I then attempted to install into the users directory, but can not get the connection string in the app.config file to be correct.
So ultimately, my questions are:
1. Where do I need to install an accdb file so that it is not read only?
2. How do I configure that directory in the FileSystem within VS2010?
3. What should the connection string in the app.config look like?
I would like this to work in XP, Vista, and W7 if possible. It would be okay to create multiple setup projects if need be for it to work across multiple OS.
You should install the db file to the LocalAppDataFolder.
It seems you've tried this...
But can not get the connection string in the app.config file to be correct.
Rather than set the connection string at design time you should set the string at runtime
From ErikEJ's answer to a similar question
string fileName = System.IO.Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"SqlCe35AddinStore.sdf");
string connString = string.Format("Data Source={0};", fileName);

Resources