1. Trang chủ
  2. » Công Nghệ Thông Tin

Connecting to microsoft SQL server

25 239 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 25
Dung lượng 268,5 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Introduction  We are going to discuss establishing an connection to a SQL Server Database.. Security ModesThere are two types of modes:  Standard Mode default  Integrated Mode Standar

Trang 1

Connecting to Microsoft SQL Server

Tuc Goodwin

Trang 2

Introduction

 We are going to discuss establishing an

connection to a SQL Server Database

 You will learn that there is an easy way and a hard way

Trang 4

Overview – What do you have to know…

Trang 5

Security Modes

There are two types of modes:

 Standard Mode (default)

 Integrated Mode

Standard and Integrated Security

DATABASE

Database Security Users, Groups, Permissions

Trang 6

Database Interfaces

DB-Library ODBC

Sources

Trang 7

Connecting to a SQL Server Data Source

 Connecting with Data Control

 Connecting with ADO Data Control (ADO)

 Connecting with ADO Data Control (DSN)

 Connecting with ADO Data Control (UDL)

 Connecting with ADO (Programmatically)

Trang 8

Connecting with Data Control

 Natively it can’t be done…

 However…

Server database, then we can connect to that.

 Downside

 DEMO

Trang 9

Connecting with ADO Data Control (ADO)

 Natively it connects fine

 Set the Connection string property

 Set the RecordSource property

 DEMO

Trang 10

Connecting with ADO Data Control (DSN)

 Natively it connects fine

 Set the Connection string property

 Set the RecordSource property

Trang 11

Data Source Name (DSN)

A DSN is a registry entry (Machine DSN) or text file (File DSN) that contains information about a

database and the SQL Server it resides on.

Control Panel ->

Administrative Tools -> Data

Sources (ODBC)

Start Menu -> Administrative

Tools -> Data Sources

(ODBC)

Trang 12

Demo – Setting up a Data Source Name

Trang 13

Example of a File DSN (Standard)

Trang 14

Example of a File DSN (Integrated)

Trang 15

DEMO – ADO Control with DSN

Trang 16

Connecting with ADO Data Control (UDL)

 Natively it connects fine

 Set the Connection string property

 Set the RecordSource property

Trang 17

Creating a UDL

 Create a file with a UDL extention

 Double-click on the icon

Trang 18

Set the Provider

Trang 19

Set the Connection and Test

Trang 20

Examine the UDL

[oledb]

; Everything after this line is an OLE DB initstring

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=sa;Initial Catalog=pubs;Data Source=dalgoodwin3\dalgoodwin32000

Look familiar?

Can you say “ Connection string”

Trang 21

DEMO – ADO Control with UDL

Trang 22

Connecting with ADO (Programmatically)

 Declare an ADO connection object

 Set the Connection String

 Open the Connection

 Instantiate the recordset etc…

Trang 23

DEMO – Connect with ADO

Trang 24

Other ways

 RDO – Similar to ADO Use DSN or DSN-less connection strings

 ODBCDirect – Too much for this lesson

 ODBC – lots of API calls Better off with the ADO abstraction

Ngày đăng: 23/10/2014, 18:38

TỪ KHÓA LIÊN QUAN

w