fungiscience Posted February 22, 2007 Report Share Posted February 22, 2007 Hello, I try to connect to a DBF File (a dBase file which is supposed to be supported by the LabVIEW Database Connectivity Toolkit) using the LabVIEW Database Connectivity Toolkit. I always get an error when I supply the Open Connection VI with the DSN, or the file path or when I configure manually the dialog with Microsoft JET 4.0 OLE DB Provider and the file path to the dbf file (The test connection doesn't work either). Here is the error from the dialog Test connection button : Test connection failed because of an error in initializing provider. Unrecognised database format Here is the error when a supply the file path in input : Error 1 occurred at DB Tools Open Connec (Path).vi->MEPR-Query Database-Get data.vi Possible reason(s): The file provided is not a data link (UDL) or a file DSN. Any tips? Quote Link to comment
Yair Posted February 22, 2007 Report Share Posted February 22, 2007 I don't have any experience with this file type, but if the Test Connection button fails, how do you expect LabVIEW to be able to use the connection? All LV does is call the ADO methods which use this connection. You have to get the Test Connection button to return a successful connection before you can proceed. Is the DB on another computer? Are you defining the connection correctly (username, etc.)? Is it possible there is something corrupted with the DB file? And so on? You might want to search Google for problem related to connections to dBase DBs. Quote Link to comment
fungiscience Posted February 22, 2007 Author Report Share Posted February 22, 2007 QUOTE(yen @ Feb 21 2007, 12:45 PM) I don't have any experience with this file type, but if the Test Connection button fails, how do you expect LabVIEW to be able to use the connection? All LV does is call the ADO methods which use this connection. You have to get the Test Connection button to return a successful connection before you can proceed.Is the DB on another computer? Are you defining the connection correctly (username, etc.)? Is it possible there is something corrupted with the DB file? And so on? You might want to search Google for problem related to connections to dBase DBs. Yes the DB is originally on another computer, but i copied the DBF file on the local computer. It<s not corrupted, I can open it with Microsoft Access. The connection is defined correctly as well! QUOTE(fungiscience @ Feb 21 2007, 01:30 PM) Yes the DB is originally on another computer, but i copied the DBF file on the local computer. It<s not corrupted, I can open it with Microsoft Access. The connection is defined correctly as well! Actually, it just seems to me that LabVIEW Database Connectivity Toolkit doesn't provide access to dBase DBF files. First, when you browse for database file, using the dialog prompt from the Open Connection VI, only Microsoft Access database files (.mdb) is defined in the dropdown list. Second, my database file is consistent and working : I can access it from Microsoft Access easily. And the Test connection button tells me : Unrecognised database format...which brings me to the conclusion that this file type isn't supported! Quote Link to comment
Herbert Posted February 22, 2007 Report Share Posted February 22, 2007 You might need to play with the connection string. This website has a comprehensive collection of sample connection strings: http://www.carlprothman.net/Default.aspx?tabid=81. The connection string for Jet 4.0 has an optional part called "Extended Properties" that can be used to specify file types other than mdb, plus the parameters needed to open these files. I think it is sufficient to just include "Extended Properties=DBASE III" or "Extended Properties=DBASE IV" with your connection string. Worst case this might work for you. Hope that helps, Herbert Quote Link to comment
Herbert Posted February 23, 2007 Report Share Posted February 23, 2007 On further investigation, you might need to have ISAM support installed. MSDN recommends getting it from Borland (link), but there are 3rd party providers, too. That obviously does not solve the mystery of why MS Access can read dBase without having ISAM installed. If you use the dialog for configuring your "Microsoft Data Link" and you select Jet 4.0 and your DBF file, then test the connection, the error will say "[..] Unrecognized Database Format [...]". Now, go to the "All" tab of the dialog and pick "Extended Properties", click on "Edit Value..." and put in the specifier for the dBase version you are using. Now, go back to the "Connection" tab and press "Test Connection" and it will lament the absence of an ISAM component. Why are you using dbase anyway? Supporting legacy software? Let us know if you get it up and running ... Herbert Quote Link to comment
xtal Posted February 23, 2007 Report Share Posted February 23, 2007 When I was at NI and responsible for the Database Connectivity Toolkit, I did test it with dBase and DBF files. Everything worked fine and if there were any problems connecting, they weren't significant enough for me to remember or write down. I actually used dBase in some of my presentations because all the shipping examples worked with Access and I liked showing other database management systems for contrast. I'm sorry I don't remember more, but you can be assured the toolkit works with dBase files. I know it's old technology and I usually don't recommend it, but try ODBC to connect instead of the Microsoft Data Link. This might bypass some of the MS drivers and possibly some of the ISAM business Herbert mentions. Quote Link to comment
AlanChen Posted May 23, 2008 Report Share Posted May 23, 2008 QUOTE (fungiscience @ Feb 21 2007, 06:05 PM) Hello,I try to connect to a DBF File (a dBase file which is supposed to be supported by the LabVIEW Database Connectivity Toolkit) using the LabVIEW Database Connectivity Toolkit. I always get an error when I supply the Open Connection VI with the DSN, or the file path or when I configure manually the dialog with Microsoft JET 4.0 OLE DB Provider and the file path to the dbf file (The test connection doesn't work either). Here is the error from the dialog Test connection button : Test connection failed because of an error in initializing provider. Unrecognised database format Here is the error when a supply the file path in input : Error 1 occurred at DB Tools Open Connec (Path).vi->MEPR-Query Database-Get data.vi Possible reason(s): The file provided is not a data link (UDL) or a file DSN. Any tips? Hi, You may need to replace your dbf file with a backup. If you don't have any backup, I think you can try some repair tools. I have used a tool called http://www.datanumen.com/adr/' rel='nofollow' target="_blank">Advanced DBF Repair to repair my DBF database. It is a powerful tool and worked well for me, but it is not free, so can be used in the end. Hope this still can be useful. Quote Link to comment
Phillip Brooks Posted July 13, 2011 Report Share Posted July 13, 2011 Another great place for getting connection string info: http://connectionstrings.com/ For dBASE examples; http://connectionstrings.com/dbf-foxpro Quote Link to comment
Roger_1 Posted July 15, 2011 Report Share Posted July 15, 2011 Another great place for getting connection string info: http://connectionstrings.com/ For dBASE examples; http://connectionstr....com/dbf-foxpro Thanks Phillip. I can now use Access 2007 database files from LabVIEW instead of the Access 2000 file format I've been using by switching "Provider=Microsoft.Jet.OLEDB.4.0" to "Provider=Microsoft.ACE.OLEDB.12.0". Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.