dbf

Efficient way to bulk insert into Dbase (.dbf) files

五迷三道 提交于 2019-12-01 18:59:49
Im currently using OleDBCommand.ExecuteNonQuery (repeatedly called) to insert as much as 350,000 rows into dbase files (*.dbf) at a time from a source DataTable. I'm reusing an OleDbCommand object and OleDbParameters to set the values to be inserted each time when the insert statement is called. Inserting 350,000 rows currently takes my program about 45 mins. Is there a more efficient way to do this? Does something similar to the Bulk Insert option used in SQL Server exist for Dbase (*.dbf) files? Fixed the problem by changing the OleDB driver from Jet to vfpoledb. This cut the total time from

Reading DBF with VFPOLEDB driver

与世无争的帅哥 提交于 2019-12-01 17:38:06
I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using (OleDbConnection conn = new OleDbConnection( @"Provider=VFPOLEDB.1;Data Source=" + fi.DirectoryName + "

Reading DBF with VFPOLEDB driver

只谈情不闲聊 提交于 2019-12-01 16:41:37
问题 I am using VFPOLEDB driver to read DBF files and I keep getting this error and I am not sure why and how to fix the problem: The provider could not determine the Decimal value. For example, the row was just created, the default for the Decimal column was not available, and the consumer had not yet set a new Decimal value. Here is the code. I call this routine to return a DataSet of the DBF file and display the data in a DataGridView. public DataSet GetDBFData(FileInfo fi, string tbl) { using

How can I save a DataTable to a .DBF?

99封情书 提交于 2019-12-01 05:43:26
问题 I've been working on a program to read a dbf file, mess around with the data, and save it back to dbf. The problem that I am having is specifically to do with the writing portion. private const string constring = "Driver={Microsoft dBASE Driver (*.dbf)};" + "SourceType=DBF;" + "DriverID=277;" + "Data Source=¿;" + "Extended Properties=dBASE IV;"; private const string qrystring = "SELECT * FROM [¿]"; public static DataTable loadDBF(string location) { string filename = ConvertLongPathToShort

Error when writing data into dbf in Python

馋奶兔 提交于 2019-12-01 04:49:54
I got this err: DbfError: unable to modify fields individually except in with or Process() How to fix it? This is my code : with dbf.Table("aa.dbf") as table: for record in table: record[3] = 200 dbf is different from most other DB packages in that instead of getting a completely seperate data structure (a bunch of rows as tuples, for example) you are working directly with the dbf file itself. The problem I found myself running into was that when I would update multiple fields at once: record.name = 'Some Name' record.age = current_year -birth_year record.hair_color = base_color * sun_tint if

How to open DBase files (.DBF) in Matlab?

寵の児 提交于 2019-12-01 04:36:05
I've googled and searched through Matlab Central, but cannot find any way to open DBF files directly in Matlab. There are some references to DBFREAD function in TMW File Exchange, but it's not available anymore. Is it really a problem? I do have Database toolbox, but could not find dbf support there. I don't want to use Excel or other tools for converting files outside of Matlab, since I have a lot of files to process. ODBC also is not good, I need the code to work under Mac and Unix as well. Please help. I contacted with Brian Madsen, the author of DBFREAD function, which was deleted from

Error when writing data into dbf in Python

冷暖自知 提交于 2019-12-01 01:43:14
问题 I got this err: DbfError: unable to modify fields individually except in with or Process() How to fix it? This is my code : with dbf.Table("aa.dbf") as table: for record in table: record[3] = 200 回答1: dbf is different from most other DB packages in that instead of getting a completely seperate data structure (a bunch of rows as tuples, for example) you are working directly with the dbf file itself. The problem I found myself running into was that when I would update multiple fields at once:

How to modify dbf files in Python

≯℡__Kan透↙ 提交于 2019-11-30 21:58:16
Suppose I have different number of dbf files in some folders under the root directory, d:\myfolder . The content of a dbf file looks like the following: Field1 11110481123 12150480021 ... I want to add a field (say, Field1 ) that contains only the last 4 digits of the values in Field2 . Field1 Field2 11110481123 1123 12150480021 0021 ... ... Then, I want to delete Field1 . How can I do the job for all the dbf files that are scattered across different folders in Python? You would need the module called dbf available via pypi ( pip install dbf ). Here's a snippet of how you can add and delete

Get data in a .dbf file using c#

那年仲夏 提交于 2019-11-30 12:46:33
How can I get the data in a .dbf file using c#?? What I want to do is to read the data in each row (same column) to further process them. Thanks. You may create a connection string to dbf file , then using OleDb, you can populate a dataset, something like: string constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=directoryPath;Extended Properties=dBASE IV;User ID=Admin;Password=;"; using (OleDbConnection con = new OleDbConnection(constr)) { var sql = "select * from " + fileName; OleDbCommand cmd = new OleDbCommand(sql, con); con.Open(); DataSet ds = new DataSet(); ; OleDbDataAdapter da =

How to solve “Call to undefined function dbase_open() ” error in windows

给你一囗甜甜゛ 提交于 2019-11-30 09:22:22
问题 Hi i want to load DBF file to mysql, am using xampp,php version 5.5.6 i had write the below code, But am getting Error --- Fatal error: Call to undefined function dbase_open() in C:\xampp\htdocs\imports\import_geo.php on line 47 $dbf = dbase_open('OUTLETS/regions.dbf', 0); $num_records = dbase_numrecords($dbf); for($i=1;$i<=$num_records;$i++) { $record = dbase_get_record_with_names($dbf, $i); $stmt_bricks->execute(array( ':id' => $next_brick_id, ':type' => 'Region', ':code' => $record['REG