Thread View: borland.public.cppbuilder.database.ado
6 messages
6 total messages
Started by Mike
Fri, 07 Dec 2007 18:14
Crate a MS Access database at runtime
Author: Mike
Date: Fri, 07 Dec 2007 18:14
Date: Fri, 07 Dec 2007 18:14
12 lines
1154 bytes
1154 bytes
How do I create a new MS Access database at runtime? Later on it is my plan to fill the database with data by the means of the ADO interface. However I am not sure if it is possible to create a MS database from scratch with ADO... Any suggestions? Other posibilities? thanks in advance Mike
Re: Crate a MS Access database at runtime
Author: Viatcheslav Valerievitch Vassili...
Date: Sat, 08 Dec 2007 12:29
Date: Sat, 08 Dec 2007 12:29
49 lines
2456 bytes
2456 bytes
Import ADOX type library and execute
Adox_tlb::TCOM_Catalog cat = CoCatalog::Create();
cat->Create(strConn.c_bstr());
or
CatalogPtr cat = CoCatalog::Create();
cat->Create(strConn);
You may also need to add if you use C++ Builder 6
#include <comobj.hpp>
namespace System
{
void __fastcall CheckSafecallResult(HRESULT hr)
{
OleCheck(hr);
}
}
All strings should be declared as WideString, not as AnsiString.
//------------------------------------------
Regards,
Vassiliev V. V.
http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
ADO.Net
http://www.oledbdirect.com - The fastest way to access MS SQL Server,
MS Jet (Access) and Interbase (through OLEDB)
"Mike" <ptyven@hotmail.com> �������/�������� � �������� ���������:
news:47598d82$1@newsgroups.borland.com...
> How do I create a new MS Access database at runtime?
>
> Later on it is my plan to fill the database with data by the means of the
> ADO interface. However I am not sure if it is possible to create a MS
> database from scratch with ADO...
>
> Any suggestions?
>
> Other posibilities?
>
> thanks in advance
> Mike
>
Re: Crate a MS Access database at runtime
Author: Mark Richards
Date: Mon, 10 Dec 2007 18:34
Date: Mon, 10 Dec 2007 18:34
20 lines
1601 bytes
1601 bytes
> CatalogPtr cat = CoCatalog::Create(); > cat->Create(strConn); How do I set strConn to custom values? On a TForm i have several controls, which the user can enter details about where to create the new database TEdit txtDatabasepath Fully qualified file name entered here TEdit txtUserName User name is entered here TEdit txtPassword Password is entered here TCheckBox chkEncrypt If Checked then the database should be encrypted So for example txtDatabasepath->Text = "f:\risks\rsisks01.mdb"; txtUserName->Text = "boris"; txtPassword->Text = "letmein"; chkEncrypt->Checked = true; What would I need to do to build the strConn for this?
Re: Crate a MS Access database at runtime
Author: Verne H. Bohlender
Date: Wed, 12 Dec 2007 03:01
Date: Wed, 12 Dec 2007 03:01
42 lines
2510 bytes
2510 bytes
Hi Mark, I think you're the fellow I need to talk to about my experimental Telephone program I'd like to play with to teach myself more VCL stuff. I know full well how to made the database and in fact have but need to know the items I need on the form to use the 'base'. I like the suggestions you make to Crate on making same but what I need is to know just a little more than you show here. e.g. I need what from the DATABASE item list and TEdit boxes ?? plus the code for just a couple would surely help me. If I can get to read one name that will help me to build almost anything after that. I've used Visual Basic quite a bit in the past but love working with Borland now. Verne On Mon, 10 Dec 2007 18:34:28 -0000, "Mark Richards" <markcr@wapthespamntlworld.com> wrote: >> CatalogPtr cat = CoCatalog::Create(); >> cat->Create(strConn); > >How do I set strConn to custom values? > >On a TForm i have several controls, which the user can enter details about >where to create the new database > >TEdit txtDatabasepath Fully qualified file name entered here >TEdit txtUserName User name is entered here >TEdit txtPassword Password is entered here >TCheckBox chkEncrypt If Checked then the database should be encrypted > >So for example >txtDatabasepath->Text = "f:\risks\rsisks01.mdb"; >txtUserName->Text = "boris"; >txtPassword->Text = "letmein"; >chkEncrypt->Checked = true; > >What would I need to do to build the strConn for this? > >
Re: Crate a MS Access database at runtime
Author: Viatcheslav Valerievitch Vassili...
Date: Wed, 12 Dec 2007 08:01
Date: Wed, 12 Dec 2007 08:01
41 lines
2833 bytes
2833 bytes
Look at connection string on http://www.connectionstrings.com/ . For your case connection string should be: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\risksk\rsisks01.mdb;User ID=boris;Password=letmein I am not sure that Access database can be encrypted. //------------------------------------------ Regards, Vassiliev V. V. http://www.managed-vcl.com - using .Net objects in Delphi for Win32 + ADO.Net http://www.oledbdirect.com - The fastest way to access MS SQL Server, MS Jet (Access) and Interbase (through OLEDB) "Mark Richards" <markcr@wapthespamntlworld.com> �������/�������� � �������� ���������: news:475d86a4$1@newsgroups.borland.com... >> CatalogPtr cat = CoCatalog::Create(); >> cat->Create(strConn); > > How do I set strConn to custom values? > > On a TForm i have several controls, which the user can enter details about > where to create the new database > > TEdit txtDatabasepath Fully qualified file name entered here > TEdit txtUserName User name is entered here > TEdit txtPassword Password is entered here > TCheckBox chkEncrypt If Checked then the database should be encrypted > > So for example > txtDatabasepath->Text = "f:\risks\rsisks01.mdb"; > txtUserName->Text = "boris"; > txtPassword->Text = "letmein"; > chkEncrypt->Checked = true; > > What would I need to do to build the strConn for this? > > >
Re: Crate a MS Access database at runtime
Author: Mark Richards
Date: Wed, 12 Dec 2007 17:01
Date: Wed, 12 Dec 2007 17:01
1 lines
1101 bytes
1101 bytes
I have sent you an email.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads