TAILIEUCHUNG - Creating SQL Server Objects with ActiveX Data Objects

Tạo SQL Server Đối tượng với ActiveX Data Objects Đó là giá trị phải đề cập đến một ví dụ của việc tạo ra một đối tượng bảng mới với các lĩnh vực và khóa chính quy định, mặc dù phần lớn các công việc của việc tạo ra các đối tượng sử dụng ADO và SQL Server được thực hiện trong T-SQL Báo cáo mà bạn tạo | Creating SQL Server Objects with ActiveX Data Objects It is worthwhile to mention an example of creating a new table object with fields and primary key specified even though the majority of the work of creating objects using ADO and SQL Server is done in the T-SQL Statement that you create. You will execute this statement using the Command object as shown in Listing . Listing Creating SQL Server Objects with ADO and T-SQL Sub CreatingASQLServerObjectFromADO ByVal txtResults As TextBox Dim cnn As New Dim cmd As New Dim prm As Dim rstOld As New Dim rstNew As New -- In .NET we can assign values as we declare variables. This is where the hard work is. Dim strSQL As String CREATE TABLE Test PrimarylntFld Integer IDENTITY 1 1 PRIMARY KEY Field2 Text -- Open the connection OpenNorthwindADOConnection cnn -- Set up the Command object to use the SQL string. cnn strSQL -- Execute the command End Sub This routine is a lot like the previous example except for the SQL statement and the fact that results aren t displayed. You can see the results by going to the Visual Studio .NET Server Explorer zeroing in on the tables for the Northwind database and opening the new Test table in Design mode as shown in Figure . Figure . Creating objects such as this table is just a matter of learning the correct SQL syntax. Note If you already had the tables displayed for Northwind you might need to right-click on the Tables node and choose .

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.