🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2319

Re: Create a new table

#2319
From: Lee
Date: Tue, 19 Aug 2003 06:09
48 lines
2587 bytes
Hello,

I see that this is exactly what I need, but I am unsure on how to implement
the code to get the results that I desire.

Thank you for your help though...  At least I have a map, with a
destination.

Lee


"Viatcheslav V. Vassiliev" <support@oledbdirect.com> wrote in message
news:3f40a28b$1@newsgroups.borland.com...
> You are using OleVariant to work with Com object and I prefere to use
> imported type library. So I will show code in JScript - you should have no
> problems converting it to C++:
>
> //Database file
> var db = "C:\\Temp\\Test.mdb";
> //Connection string
> var strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" +
>  "Data Source=" + db;
>
> //Create database
> var cat = new ActiveXObject("ADOX.Catalog");
> cat.Create(strConn);
> cat = null;
>
> //Open connection
> var conn = new ActiveXObject("ADODB.Connection");
> conn.Open(strConn, "", "", -1);
>
> //SQL DDL command returns no recordset, this will optimize execute method
> var adExecuteNoRecords = 0x80;
>
> //Create table - here you can execute any SQL command
> conn.Execute("Create table [MyTable] ([Col1] Int Primary Key, [Col2]
> VarChar(15))",
>  null, adExecuteNoRecords);
>
> ----------------------------------------------------------------
> Regards,
> Viatcheslav V. Vassiliev
> http://www.oledbdirect.com
> The fastest way to access MS SQL Server, MS Jet (MS Access)
> and Interbase (through OLEDB) databases.
>
>
Technical Details
Message-ID: <3f41bf11@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!news.astraweb.com!news-small.astraweb.com!news-out.spamkiller.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f3fde36$1@newsgroups.borland.com> <3f407796$1@newsgroups.borland.com> <3f408401$1@newsgroups.borland.com> <3f40a28b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,5ff793e5206e9a54
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-08-18 23:25:27 PST
From: "Lee" <gobroski@elltel.net>
Newsgroups: borland.public.cppbuilder.database.ado
References: <3f3fde36$1@newsgroups.borland.com> <3f407796$1@newsgroups.borland.com> <3f408401$1@newsgroups.borland.com> <3f40a28b$1@newsgroups.borland.com>
Subject: Re: Create a new table
Date: Mon, 18 Aug 2003 23:09:24 -0700
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 12.18.161.26
Message-ID: <3f41bf11@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1061273361 12.18.161.26 (18 Aug 2003 23:09:21 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!newsfeed.news2me.com!news.astraweb.com!news-small.astraweb.com!news-out.spamkiller.net!propagator2-maxim!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail