BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Deleting a Table within a MSAccess Database

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
Nigel
Guest





PostPosted: Wed Feb 16, 2005 9:24 am    Post subject: Deleting a Table within a MSAccess Database Reply with quote



Hi everyone,
How do I delete a table in a MSAccess Database using ADO?

Thanks Nigel


Back to top
Steve Aletto
Guest





PostPosted: Wed Feb 16, 2005 2:25 pm    Post subject: Re: Deleting a Table within a MSAccess Database Reply with quote



Quote:
How do I delete a table in a MSAccess Database using ADO?

ADOQueryX->SQL->Text = "DROP TABLE TableName";
ADOQueryX->ExecSQL();

HTH,

Steve.



Back to top
Jochen Reichenberg
Guest





PostPosted: Tue Feb 22, 2005 8:38 am    Post subject: Re: Deleting a Table within a MSAccess Database Reply with quote



I would recommend to use TADOCommand, instead of TADOQuery...

Joe


"Steve Aletto" <steve_alettoANTI (AT) SPAMhotmail (DOT) com> schrieb im Newsbeitrag
news:421357e8$2 (AT) newsgroups (DOT) borland.com...
Quote:
How do I delete a table in a MSAccess Database using ADO?

ADOQueryX->SQL->Text = "DROP TABLE TableName";
ADOQueryX->ExecSQL();

HTH,

Steve.





Back to top
Steve Aletto
Guest





PostPosted: Tue Feb 22, 2005 12:41 pm    Post subject: Re: Deleting a Table within a MSAccess Database Reply with quote

Quote:
I would recommend to use TADOCommand, instead of TADOQuery...

Surely TADOCommand is another suitable possibility. But
recommending it or not depends on the application. My snippet
just showed how to do the requested command.

Steve.



Back to top
Jochen Reichenberg
Guest





PostPosted: Tue Feb 22, 2005 2:22 pm    Post subject: Re: Deleting a Table within a MSAccess Database Reply with quote

Sorry, I messed something up. I thought TADOQuery woldn't have an
ExecSQL-Method. My mistake.

Jochen

"Steve Aletto" <steve_alettoANTI (AT) SPAMhotmail (DOT) com> schrieb im Newsbeitrag
news:421b2877$1 (AT) newsgroups (DOT) borland.com...
Quote:
I would recommend to use TADOCommand, instead of TADOQuery...

Surely TADOCommand is another suitable possibility. But
recommending it or not depends on the application. My snippet
just showed how to do the requested command.

Steve.





Back to top
Elizabeth
Guest





PostPosted: Mon Feb 06, 2006 5:00 am    Post subject: Re: Using TAdoQuery to insert record in MS Access Reply with quote

Hi,

Your solution worked. Now I want to insert a record in an excel sheet.
The following code works when I am inserting a numeric record. e.g

ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('1', '2')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();

But I want to insert text in an excel sheet.
I am using the following code
ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('A', 'B')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();


But I get a "datatype mismatch error".
Has anyone any solution how to do it ?

Thanks,
Elizabeth.




"Tom" <tom (AT) net (DOT) com> wrote in message
news:43e39813$1 (AT) newsgroups (DOT) borland.com...
Quote:
ADOQuery1->SQL->Add("INSERT INTO TableName (FieldName1,FieldName2,...)
VALUES ('Value1','Value2',...)");
ADOQuery1->Open();


Elizabeth wrote:
Hi All,

I want to insert a record in MS access database using TAdoQuery.
Has anyone any idea how to do it ?

thanks,
Elizabeth.

Back to top
Tom
Guest





PostPosted: Mon Feb 06, 2006 9:00 pm    Post subject: Re: Using TAdoQuery to insert record in MS Access Reply with quote

It looks like you're trying to enter text data in non text field, so
check if you are inserting the correct data into the correct fields?

When entering data, name the fields in which you want to enter data, and
then add corresponding values.

ADOQuery1->SQL->Add("INSERT INTO [Sheet1](firstName, middleName,
lastName, age) VALUES('Luka','Gigi','Majnaric','25')


Regards




Elizabeth wrote:
Quote:
Hi,

Your solution worked. Now I want to insert a record in an excel sheet.
The following code works when I am inserting a numeric record. e.g

ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('1', '2')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();

But I want to insert text in an excel sheet.
I am using the following code
ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('A', 'B')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();


But I get a "datatype mismatch error".
Has anyone any solution how to do it ?

Thanks,
Elizabeth.




"Tom" <tom (AT) net (DOT) com> wrote in message
news:43e39813$1 (AT) newsgroups (DOT) borland.com...
ADOQuery1->SQL->Add("INSERT INTO TableName (FieldName1,FieldName2,...)
VALUES ('Value1','Value2',...)");
ADOQuery1->Open();


Elizabeth wrote:
Hi All,

I want to insert a record in MS access database using TAdoQuery.
Has anyone any idea how to do it ?

thanks,
Elizabeth.



Back to top
Elizabeth
Guest





PostPosted: Tue Feb 07, 2006 6:00 am    Post subject: Re: Using TAdoQuery to insert record in MS Access Reply with quote

Hey Thanks a lot Tom.
As you said I was not naming the fields before entering data.
I named the fields in the excel sheet and then entered the data it worked
:-)

Thanks,
Elizabeth


"Tom" <tom (AT) net (DOT) com> wrote in message news:43e7b12c (AT) newsgroups (DOT) borland.com...
Quote:
It looks like you're trying to enter text data in non text field, so
check if you are inserting the correct data into the correct fields?

When entering data, name the fields in which you want to enter data, and
then add corresponding values.

ADOQuery1->SQL->Add("INSERT INTO [Sheet1](firstName, middleName,
lastName, age) VALUES('Luka','Gigi','Majnaric','25')


Regards




Elizabeth wrote:
Hi,

Your solution worked. Now I want to insert a record in an excel sheet.
The following code works when I am inserting a numeric record. e.g

ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('1', '2')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();

But I want to insert text in an excel sheet.
I am using the following code
ADOQuery1->SQL->Add("Insert into [Sheet1$] Values('A', 'B')");

ADOQuery1->ExecSQL();
ADOQuery1->Close();


But I get a "datatype mismatch error".
Has anyone any solution how to do it ?

Thanks,
Elizabeth.




"Tom" <tom (AT) net (DOT) com> wrote in message
news:43e39813$1 (AT) newsgroups (DOT) borland.com...
ADOQuery1->SQL->Add("INSERT INTO TableName (FieldName1,FieldName2,...)
VALUES ('Value1','Value2',...)");
ADOQuery1->Open();


Elizabeth wrote:
Hi All,

I want to insert a record in MS access database using TAdoQuery.
Has anyone any idea how to do it ?

thanks,
Elizabeth.



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.