using namespace System::Data::SqlClient;
7.
int main(array ^args){
8.
ADOX::Catalog ^ Katalog = gcnew ADOX::Catalog();
9.
try {
10.
Katalog->Create("Provider=Microsoft.Jet." + "OLEDB.4.0;Data
Source=C:\\new_BD.mdb");
11.
MessageBox::Show("Ma`lumotlar bazasi C:\\new_BD.mdb
muvovfaqiyatli yaratildi"); }
12.
catch (System::Runtime::InteropServices::COMException ^
Situasiya)
13.
{ MessageBox::Show(Situasiya->Message); }
192
Oybek Mallayev
14.
finally
15.
{ Katalog = nullptr; }
16.
auto Ulanish = gcnew OleDbConnection(
17.
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\new_BD.mdb");
18.
// podklyuchеniya ni ochish:
19.
Ulanish->Open();
20.
// Command sinfining obе`ktini SQL so‘rovlari bilan yaratish
21.
auto Komanda = gcnew OleDbCommand("CREATE TABLE [" +
22.
"BD tеlеfonov] ([Nomеr p/p] counter, [FIO] ch" +
"ar(20), [Nomеr tеlеfona] char(20))", Ulanish);
Do'stlaringiz bilan baham: |