Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2004
    Posts
    4

    Unanswered: IN DICTIONARY does not work in PervasiveOLEDB

    My language I use is Delphi and ADO components for the data connections. I wrote a program to extract information from Dataflex, this all works fine.

    In the beginning I thought I would use ADO and OLEDB for ODBC, this also worked great and the SQL script worked fine. My concern was that the Pervasive ODBC connected had to already be set and moving from computer to computer this was not always the case.

    Then I thought I would use ADO and OLEDB for Pervasive. I set it all up and most of the script worked. The only issue I have is that the last SQL statement doesn't work under this OLEDB driver. It doesn't return any errors, it just doesn't update the table info.

    Remember this did work using OLEDB for ODBC

    Here is the script and under that I have the connection detail for the ADO component if it helps

    CREATE TABLE "CUST2"
    (
    "CUSTOMER" INTEGER NOT NULL ,
    "EMAIL_ADDRESS" CHAR ( 60 ) NOT NULL ,
    "NUM_OF_MALES" SMALLINT NOT NULL ,
    "NUM_OF_CHILDREN" SMALLINT NOT NULL ,
    "EMAIL_DATE" DATE NOT NULL ,
    "UNITYMAIL_ID" INTEGER NOT NULL ,
    "UNSUB_MAIL" CHAR ( 1 ) NOT NULL ,
    "INVALID_MAIL" CHAR ( 1 ) NOT NULL ,
    )
    #
    CREATE UNIQUE INDEX Key1 ON "CUST2" (
    "CUSTOMER" ASC
    )
    #

    ALTER TABLE "CUST2" IN DICTIONARY USING 'CUST2.btr'
    #



    Here is the component code


    procedure TForm1.BitBtn1Click(Sender: TObject);
    var
    result : integer;
    ScriptQuery : TADOQUERY;
    begin
    ScriptQuery :=TADOQUERY.Create(self);

    ScriptQuery.ConnectionString := 'Provider=PervasiveOLEDB;Data
    Source=I:\DATA;Location=I:\DATA;';

    ScriptQuery.SQL.Text := 'ALTER TABLE "CUST2" IN DICTIONARY USING 'CUST.btr2''';
    ScriptQuery.ExecSQL;

    ScriptQuery.free;
    end;


  2. #2
    Join Date
    Dec 2001
    Posts
    1,109
    Provided Answers: 4
    Why not just use:
    CREATE TABLE "CUST2" using 'cust.btr2'
    (
    "CUSTOMER" INTEGER NOT NULL ,
    "EMAIL_ADDRESS" CHAR ( 60 ) NOT NULL ,
    "NUM_OF_MALES" SMALLINT NOT NULL ,
    "NUM_OF_CHILDREN" SMALLINT NOT NULL ,
    "EMAIL_DATE" DATE NOT NULL ,
    "UNITYMAIL_ID" INTEGER NOT NULL ,
    "UNSUB_MAIL" CHAR ( 1 ) NOT NULL ,
    "INVALID_MAIL" CHAR ( 1 ) NOT NULL
    )
    That will eliminate the need for the ALTER TABLE.
    Mirtheil Software
    Certified Pervasive Developer
    Certified Pervasive Technician
    Custom Btrieve/VB development
    http://www.mirtheil.com
    I do not answer questions by email. Please post on the forum.

  3. #3
    Join Date
    Oct 2004
    Posts
    4
    Quote Originally Posted by mirtheil
    Why not just use:
    CREATE TABLE "CUST2" using 'cust.btr2'
    (
    "CUSTOMER" INTEGER NOT NULL ,
    "EMAIL_ADDRESS" CHAR ( 60 ) NOT NULL ,
    "NUM_OF_MALES" SMALLINT NOT NULL ,
    "NUM_OF_CHILDREN" SMALLINT NOT NULL ,
    "EMAIL_DATE" DATE NOT NULL ,
    "UNITYMAIL_ID" INTEGER NOT NULL ,
    "UNSUB_MAIL" CHAR ( 1 ) NOT NULL ,
    "INVALID_MAIL" CHAR ( 1 ) NOT NULL
    )
    That will eliminate the need for the ALTER TABLE.
    Good question. The table already exists I am just wanting to recreate the DDF information for it. As the table is a btr table I can create a real mkd add whatever indexes I want then at the end use the IN DICTIONARY to remap it to its real table, then delete the mkd.
    It was the indexes that made me go down this track, could not get them right again with the IN DICTIONARY command
    Last edited by John230873; 02-03-05 at 00:33.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •