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;
