Re: ADOX - Create new query in Access Database
- From: "Ian Hinson" <pparagon@xxxxxxxxxxxxxx>
- Date: Wed, 21 Jun 2006 21:20:48 +1000
You've used the wrong parameter for the Cat.Views.Append procedure
The second parameter should be an ADODB_TLB.Command, not a string;
See inserted/changed code below:
"Giuseppe Porzio" <giuseppe.porzio@xxxxxxx> wrote in message
news:44902444@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello!// insert code
This is my question. I'm working with Delphi 6, ADO, MS Access 2000
Database.
I want create a new view (query) in Access database with ADOX library.
This
is my code:
...
dbName := sPathStampe + '\WorkReports.mdb';
DataSource := 'Provider=Microsoft.Jet.OLEDB.4.0' +
';Data Source=' + dbName +
';Persist Security Info=False';
Cat := CoCatalog.Create;
Cat.Set_ActiveConnection ( Datasource );
sSql := 'Select * from DatiPrv';
cmd := ADODB_TLB.CoCommand.Create;
cmd.CommandType := cmdText;
cmd.CommantText := sSql;
Cat.Views.Append ('v_Prova', sSql );// change to
Cat.Views.Append('v_Prova', cmd);
....
Compilator return error on sSql parameter of Append method (IDSpatch)
thaks
Giuseppe
Italy
.
- References:
- ADOX - Create new query in Access Database
- From: Giuseppe Porzio
- ADOX - Create new query in Access Database
- Prev by Date: Re: Connect over internet
- Next by Date: Simulating VB Nothing variant in Delphi
- Previous by thread: Re: ADOX - Create new query in Access Database
- Next by thread: data type of field value
- Index(es):