Article View: borland.public.cppbuilder.database.ado
Article #1026MS Access databases and SQL insert
From: Stefano Bonifazi
Date: Tue, 14 Dec 2004 23:31
Date: Tue, 14 Dec 2004 23:31
39 lines
2425 bytes
2425 bytes
Hi All!!
I'm using an simple test MS Access database.
I connect to the db through a TADOConnection with a connection string:
"Provider=MSDASQL.1;Persist Security Info=False;Data Source=Database di
Microsoft Access;Initial Catalog="+Mp3CatalogsOpenDialog->FileName;
Then I have a TADODataSet linked to the prevoius TADOConnection, and a
TDataSource linked to the last.
Then I have a TDBGrid linked to the TDataSource.
Finally I have a TADOQuery linked to the same TADOConnection.
I use the TADOQuery to query the database with SQL statements. Both "SELECT"
and "DELETE" command work fine, but when I try to use INSERT i got the
following error message:
"[snip] EOleException with message 'The current provider can't give back
multiple record sets from a unique execution' [snip]" (note I tried to
translate the Italian Error message!)
My actual code was:
AnsiString SQLCommand=
"INSERT INTO MP3TAG(Title,Artist,Album,Genre,Year,Comment,File) "
"VALUES('My Title', 'My Artist', 'My Album', 'My Genre', '1978', 'Some
comment', 'c:\test.mp3')";
ADOQuery1->Close();
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add(SQLCommand);
ADOQuery1->Open();
What did happen? Should I use another kind of database to enable the sql
INSERT command? If so, how to create another type of database?
I only own MS Access 2003, where can I find other programs to create
databases?
Thank You very much in advance!
Stefano B.
Technical Details
Message-ID:
<41bf77e4@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10698b,616038963bb3e51,start X-Google-Attributes: gid10698b,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Stefano Bonifazi" <stefboombastic@tele2.it> Newsgroups: borland.public.cppbuilder.database.ado Subject: MS Access databases and SQL insert Date: Wed, 15 Dec 2004 00:31:47 +0100 Lines: 41 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original NNTP-Posting-Host: 212.141.199.16 Message-ID: <41bf77e4@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1103067108 212.141.199.16 (14 Dec 2004 15:31:48 -0800) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail