TAILIEUCHUNG - Creating a New Access Database

[ Team LiB ] Recipe Creating a New Access Database Problem You need to create a new Microsoft Access database. Solution Use ActiveX Database Objects Extensions (ADOX) from .NET through COM interop. You'll need a reference to Microsoft ADO Ext. for DDL and Security from the COM tab in Visual Studio | Team LiB Recipe Creating a New Access Database Problem You need to create a new Microsoft Access database. Solution Use ActiveX Database Objects Extensions ADOX from .NET through COM interop. You ll need a reference to Microsoft ADO Ext. for DDL and Security from the COM tab in Visual Studio .NET s Add Reference Dialog. The sample code contains an event handler and a single method Allows the user to specify the filename for the new Access database and then calls the CreateAccessDatabase method in the sample to create the database. CreateAccessDatabase This method uses ADOX through COM interop to create the new Access database having the specified filename. The C code is shown in Example 10-6. Example 10-6. File Namespaces variables and constants using System using . . . private void createButton_Click object sender e Create the save file dialog object. SaveFileDialog sfd new SaveFileDialog Set the filter for Access databases. Microsoft Access .mdb .mdb Open the dialog. if Of OK selected create the Access database. String fileName try CreateAccessDatabase fileName Microsoft Access database fileName created. Create Access Database catch ex Could not create database fileName . Create Access Database private void CreateAccessDatabase String fileName String connectString @ Provider Data Source fileName Use ADOX to create the Access database. cat new try connectString finally cat null Discussion ADO Extensions for DDL and Security ADOX extends the ADO objects and programming model with objects for schema creation and modification and for security. ADOX is used to .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.