ADOX error with fields of type AdDate

From: John Evans (johnevans_at_clear-Advantage.co.uk)
Date: 03/22/04


Date: Mon, 22 Mar 2004 16:14:54 -0000

Dear all, I am using ADOX to build tables for a SQL server 2000 database.

I am using something like:

procedure TForm1.addtable(Conn: TAdoconnection);
  var cat:catalog;
      tbl,tbl2:table;
begin
  cat:=CreateComObject(Class_catalog) as catalog;
  cat.set_Activeconnection(conn.connectionObject);

  tbl2:=CreateComObject(Class_table) as table;
  tbl2.Name:='HCallHistory';
  tbl2.Columns.Append('pkey',adChar, 5);
  tbl2.Columns.Append('HelpCallpkey',adChar, 5);
  tbl2.Columns.Append('DateAssigned',adDate, 0);
  tbl2.Columns.Append('Assignedpkey',adChar, 5);

  cat.Tables.Append(tbl2);

cat.Tables['HCallHistory'].keys.Append('PK_HCallHistory',adKeyPrimary,'pkey'
,'','');
end;

If I do not include the data field, then everything works fine. With the
date field the code fails when it tries to append the table to the catalog.

Any ideas?

regards

-- 
John Evans
Managing Director
Clear Advantage Ltd
www.Clear-Advantage.co.uk


Relevant Pages

  • Re: accessing database fields
    ... >>A data field can be access with by using the FieldByName ... >slight performance advantage over user FieldbyName but I use Fieldbyname because ... >>mask of a database field, I do create and instance of the field, so that I ... >When you define persistent tfields delphi can only use the fields you have ...
    (borland.public.delphi.database.ado)
  • Re: Contact Database Search a Year
    ... "Jeff Boyce" wrote: ... value) or contained the characters "1999" in some data field. ... Microsoft Office/Access MVP ... The rest is the same a basic database ...
    (microsoft.public.access.forms)
  • rendering images from a database
    ... If you have a table in a database with an ID field, ... (varchar), a content-type field ... you have binary data in the data field, ...
    (comp.lang.perl.misc)
  • Re: Contact Database Search a Year
    ... You described the names of some of the objects in your database. ... value) or contained the characters "1999" in some data field. ... Microsoft Office/Access MVP ... "Jeff Boyce" wrote: ...
    (microsoft.public.access.forms)
  • Re: stupid american system
    ... > Data field in database is datetime. ... It sounds like it's DataGrid's sorting ...
    (microsoft.public.dotnet.languages.csharp)