If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > IN DICTIONARY does not work in PervasiveOLEDB

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-02-05, 22:03
John230873 John230873 is offline
Registered User
 
Join Date: Oct 2004
Posts: 4
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;

Reply With Quote
  #2 (permalink)  
Old 02-02-05, 23:24
mirtheil mirtheil is offline
Registered User
 
Join Date: Dec 2001
Posts: 1,026
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.
Reply With Quote
  #3 (permalink)  
Old 02-02-05, 23:30
John230873 John230873 is offline
Registered User
 
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-02-05 at 23:33.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On