dbase

Create .DBF in C# code that is readable from Excel (VFP or not)

穿精又带淫゛_ 提交于 2019-12-13 16:20:49
问题 LANGUAGE: C#, System: Windows7, Excel 2007 I want to create a .DBF from some data, and i want to open it from Excel 2007. It can be either dBase or foxpro. I am currently doing in FoxPro9 (btw this code is from the internet): OleDbConnection con = new OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\\Temp\\;"); con.Open(); OleDbCommand cmd1 = new OleDbCommand("Create Table TestDBF (Field1 I, Field2 C(10))", con); OleDbCommand cmd2 = new OleDbCommand("Insert Into TestDBF Values (1, 'Hello')

Which header format can be assumed by reading an initial .DBF byte?

痞子三分冷 提交于 2019-12-13 14:56:46
问题 Regarding the first byte of a .DBF file and how to detect the version of xbase used (ie, the format of the rest of the file), the most comprehensive list I can compile is: Byte 0 ----------- x xxx x 001 = 0x?1 not used 0 000 0 010 = 0x02 FoxBASE 0 000 0 011 = 0x03 FoxBASE+/dBASE III PLUS, no memo x xxx x 100 = 0x?4 dBASE 7 0 000 0 101 = 0x05 dBASE 5, no memo 0 011 0 000 = 0x30 Visual FoxPro 0 011 0 001 = 0x31 Visual FoxPro, autoincrement enabled 0 011 0 010 = 0x32 Visual FoxPro, Varchar,

Search in DBF file using .idx file

别说谁变了你拦得住时间么 提交于 2019-12-13 06:11:26
问题 I have a DBF file and a index file. I want to read index file and search records satisfy some condition. (for example: search records which its StudentName begin with "A" by using Student.DBF and StudentName.idx) How do I do this programmatically? 回答1: It would be easiest to query via OleDB Connection using System.Data.OleDb; using System.Data; OleDbConnection oConn = new OleDbConnection("Provider=VFPOLEDB.1;Data Source=C:\\PathToYourDataDirectory"); OleDbCommand oCmd = new OleDbCommand();

Code or Tools to Export FoxPro to dBase

谁说我不能喝 提交于 2019-12-13 03:19:32
问题 I want to convert FoxPro table into dBase IV table. Can someone help me? That could be a code snippet or a third party tool that works with c# Prasanna 回答1: Are you familiar with wikipedias article on xbase? What about the dbf file structure specification? FoxPro and DBase are variants of XBase. However as you read the spec you'll see there are some important differences. I've never had a need to convert between the two. If faced with the need, I would either use codebase or xbase. I've used

How do i read a dbase file and apply different decoding?

烂漫一生 提交于 2019-12-12 12:25:40
问题 I have a dbf file endcoded as 866 codepage (DOS) Using the code below, I'm trying to read it. Problem is that strings I get are formed as if the file was in code page 1252. I've checked other questions on SO and other forums with no luck so far. Looking for ideas on hot to read it propperly. var ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\PathtoFile\;Extended Properties=""dBase 5.0"""; var dBaseConnection = new System.Data.OleDb.OleDbConnection(ConnectionString );

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

半城伤御伤魂 提交于 2019-12-12 04:54:01
问题 My question is pretty much the exact same as Efficient way to bulk insert into Dbase (.dbf) files - Is there an efficient way to bulk insert into dbase IV dbf files? The source data is coming from SQL Server 2012. I have Visual FoxPro available but I'd like to do this programatically from C#. 回答1: As mentioned in comment, if in VFP, you should be able to do quite easily by means of nHandle = sqlconnect( "connection string to your database" ) sqlexec( nHandle, "select * from YourTable",

Connect to SQL Server in VM using local machine

十年热恋 提交于 2019-12-11 17:15:54
问题 I would like to connect SQl server DB in VM using my local sql server management studio. What should I need for server name ? Can I use my server Windows authentication for VM in my local ? 回答1: Create an empty text file on your VM and give it extension .udl Doubleclick on it now you can set the properties easy from combobox Adjust the properties and click on "test connection" until it works Now open the file in notepad and there you see a complete connection string. Note that for SQL Server

Delphi: ADOConnection, DBASE3 and character set (bug?)

我的未来我决定 提交于 2019-12-11 03:52:51
问题 Delphi XE3, Win7 Prof. I need to write into DBASE 3 (old format) files to export data for a DOS-like application (Clipper?). Ok, I thought: MS DBASE driver can do this. But I have problem with hungarian accents. I tried this connection string: Driver={Microsoft dBASE Driver (*.dbf)};DriverID=21;Dbq=c:\temp;Extended Properties=dBASE III;charSet=CP 852;Locale Identifier=1038;Character Set=CP 852;CODEPAGE=852 As I saw it cannot write only ANSI files (the DOS app accepts CP852 chars). I tried to

Get OleDbCommandBuilder 's generated SQL commands

谁说我不能喝 提交于 2019-12-10 15:35:30
问题 I use OleDbDataAdapter and OleDbCommandBuilder to fill DataSet object with database contents, and then update database according to a changes that I made in the DataSet. The problem is that I get the exception: "Concurrency violation: the UpdateCommand affected 0 of the expected 1 records". I've found an explanation of this error: Because a record could have been modified after it was returned from the SELECT statement, but before the UPDATE or DELETE statement is issued, the automatically

Why does setting a table's RecNo property not move to that record?

杀马特。学长 韩版系。学妹 提交于 2019-12-10 13:17:59
问题 I have got a TTable component that uses the BDE to access a DBase table. There is no index on the table, so the sort order is the physical order of the records in the table. If I read the RecNo property, it contains the expected number for the current record. I was under the impression that with this constellation (BDE + DBase) it is also possible to set the RecNo property to move to the corresponding record. But apparently this does not work in my program. So: Do I remember this incorrectly?