C # solutions that do not operate on the Paradox database

Source: Internet
Author: User
Tags join odbc paradox database

With Delphi with the Database Desktop tool to open the db file, edit the table, to a field index on it, will generate a XXX.PX index file

Refer to the following document, where 4 is the second one.

http://support.microsoft.com/kb/q175168/

4. The last question and workaround applies to all SQL data sources. SQL statements that violate referential integrity of the database can cause this error to occur. The following are some of the most common failed queries:

• The simplest set of queries is the following query that you cannot change: A crosstab query with a UniqueValue property set to Yes, a SQL pass-through query, a federated query, or an update (that is, a build table) action query.

• Another very common reason is that the index of the linked ODBC table that the join contains is not unique. In this case, SQL cannot guarantee that the records in the table are unique, and that the values of the fields in the table will change with the query.

• There is a reason that there are reliable alternatives. If you try to update the join field on the "one" side of the "One-to-many" query, the operation will fail unless you enable cascading updates. Because of this, you can delegate referential integrity to the JET engine.

Reference Code

string ConnectionString = @"Driver={Microsoft Paradox Driver (*.db )};DriverID=538;Fil=Paradox 5.X;DefaultDir=C:Paradox;Dbq=C:Paradox;CollatingSequence=ASCII;PWD=;";
      using (System.Data.Odbc.OdbcConnection conn = new System.Data.Odbc.OdbcConnection(ConnectionString))
      ...{
        conn.Open();
        using (System.Data.Odbc.OdbcCommand command = conn.CreateCommand())
        ...{
          command.CommandText = " update test set aa=14";
          command.ExecuteNonQuery();
         
          command.CommandText = "select * from test";
          Console.WriteLine(command.ExecuteScalar());
        }
      }

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.