Board index » delphi » Can I create a new db and tables in SQL Server using ADOX

Can I create a new db and tables in SQL Server using ADOX

Can a new db and tables be created using ADOX.  If so where could I find
some examples?
 

Re:Can I create a new db and tables in SQL Server using ADOX


Yes, according to the books and documentation I've read.  I've never done it
though.
Quote
"Ray" <sugar_ra...@hotmail.com> wrote in message news:39f06226$1_1@dnews...
> Can a new db and tables be created using ADOX.  If so where could I find
> some examples?

Re:Can I create a new db and tables in SQL Server using ADOX


www.delphizine.com
Quote
Ray <sugar_ra...@hotmail.com> wrote in message news:39f06226$1_1@dnews...
> Can a new db and tables be created using ADOX.  If so where could I find
> some examples?

Re:Can I create a new db and tables in SQL Server using ADOX


Quote
>Can a new db and tables be created using ADOX.  If so where could I find
>some examples?

What is a "db"  ?   As far as I know ADOX works only with Access.

If db means an Access .mdb file try

uses ADOX;
var
   ADOXCataolog:TCatalog;
begin
ADOXCataolog:=TCatalog(nil);
try
   ADOXCatalog.Create1('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=new.mdb');
finally
  ADOXCataolog.free;
end;
--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Re:Can I create a new db and tables in SQL Server using ADOX


"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:d112vs0lsjall3nisfd8amv1blrp7kdi19@4ax.com...

Quote

> >Can a new db and tables be created using ADOX.  If so where could I find
> >some examples?

> What is a "db"  ?   As far as I know ADOX works only with Access.

That is not true.  ADO(X) is entirely independant of any given database
engine.  The problem is that the OLE DB provider for SQL Server only
supports about two-thirds of ADOX's functionality.  From memory you have to
use a SQL DDL statement to actually create a SQL Server database, because
the provider doesn't support catalog.create, but most of the rest of ADOX
works.  I haven't been into it in any depth but I've seen sample code.

--

Quidquid latine dictum sit, altum viditur.

Other Threads