🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: errors on MS SQL 2000 with ADOCommand

#1471
From: Sydney Delieu
Date: Wed, 30 Jun 2004 15:15
53 lines
2299 bytes
Hi James,

I am using BCB6 Ent. SP4, MS-SQL2K SP3a. I created a table as you described:

create Table Data (
   [RecNumber]            [int] IDENTITY(1,1),
   ItemNumber             Char(30),
   ItemDescription        Char(60)
   Primary key(RecNumber)
);

I then created a button with the following OnClick:

ADOCommand1->CommandText = "insert into data(ItemNumber, 
ItemDescription) values ('I101', 'First Item')";
ADOCommand1->Execute();

The connection string for my ADOCommand1 is:

Provider=SQLOLEDB.1;Password=SomePassword;Persist Security 
Info=True;User ID=SomeUsername;Initial Catalog=TestDB;Data Source=127.0.0.1

This works.

Regards,
Syd.




James Peterson wrote:
> Project convert.exe raised exception class EOleException with message
> '[Microsoft][ODBC SQL Server Driver] Optional feature not implimented'. when
> i run the program using
> 
> ADOCommand1->CommandText"insert into data(fields)values(data)";
> ADOCommand1->Execute();
> 
> I do have an AutoIncrementing field.
> create Table Data (
> [RecNumber] [int] IDENTITY(1,1),
> ItemNumber Char(30),
> ItemDescription Char(60)
> ..
> ..
> ..
> Primary key(RecNumber))
> 
> I am guessing ADOCommand is crashing on the AutoInc field. how can I correct
> this?
> 
> 
> 
Technical Details
Message-ID: <40e2d90f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40e02e27@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,36e0384e4110dcd8
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 30 Jun 2004 16:15:29 +0100
From: Sydney Delieu <syddel@hotmail.com>
User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Re: errors on MS SQL 2000 with ADOCommand
References: <40e02e27@newsgroups.borland.com>
In-Reply-To: <40e02e27@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.137.14.60
Message-ID: <40e2d90f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088608527 81.137.14.60 (30 Jun 2004 08:15:27 -0700)
Lines: 53
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail