 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Nigel Guest
|
Posted: Wed Feb 16, 2005 9:24 am Post subject: Deleting a Table within a MSAccess Database |
|
|
Hi everyone,
How do I delete a table in a MSAccess Database using ADO?
Thanks Nigel
|
|
| Back to top |
|
 |
Steve Aletto Guest
|
Posted: Wed Feb 16, 2005 2:25 pm Post subject: Re: Deleting a Table within a MSAccess Database |
|
|
| 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
|
Posted: Tue Feb 22, 2005 8:38 am Post subject: Re: Deleting a Table within a MSAccess Database |
|
|
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
|
Posted: Tue Feb 22, 2005 12:41 pm Post subject: Re: Deleting a Table within a MSAccess Database |
|
|
| 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
|
Posted: Tue Feb 22, 2005 2:22 pm Post subject: Re: Deleting a Table within a MSAccess Database |
|
|
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
|
Posted: Mon Feb 06, 2006 5:00 am Post subject: Re: Using TAdoQuery to insert record in MS Access |
|
|
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
|
Posted: Mon Feb 06, 2006 9:00 pm Post subject: Re: Using TAdoQuery to insert record in MS Access |
|
|
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
|
Posted: Tue Feb 07, 2006 6:00 am Post subject: Re: Using TAdoQuery to insert record in MS Access |
|
|
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 |
|
 |
|
|
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
|
|