Sql server classes in mumbai
Connecting to Microsoft SQL 
Server 
Presented By 
K1/ 4, Second floor, Sector-15/ 16 Market, 
Vashi, Navi Mumbai. 
Contact : 9892900103 / 9892900173 
wwwwww..vviibbrraanntttteecchhnnoollooggiieess..ccoo..iinn
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.
Agenda 
 Overview – What do you have to know… 
 Security Modes 
 Database Interfaces 
 Connecting to a SQL Server Data Source
Overview – What do you have to know… 
1. Server Name 
2. Security Information 
3. Database name 
4. Data Interface / API to use 
5. Steps to connect…
Security Modes 
There are two types of modes: 
 Standard Mode (default) 
 Integrated Mode 
CLIENT SQL SERVER 
Standard and 
Integrated Security 
DATABASE 
Database Security 
Users, Groups, 
Permissions
Database Interfaces 
OLE DB DB-ODBC 
Library 
Data 
Object 
Interfaces 
Application 
Programming 
Interfaces 
ADO RDO VBSQL DAO 
JET 
Relational 
Databases 
Other Data 
Sources
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)
Connecting with Data Control 
 Natively it can’t be done… 
 It uses DAO. 
 However… 
 If a Jet Database has already connected to a SQL 
Server database, then we can connect to that. 
 Downside 
 We’re indirectly connecting (through JET) 
 Probably not the most efficient way. 
 DEMO
Connecting with ADO Data Control 
(ADO) 
 Natively it connects fine 
 It’s ADO 
 Set the Connection string property 
 Set the RecordSource property 
 DEMO
Connecting with ADO Data Control 
(DSN) 
 Natively it connects fine 
 It’s ODBC 
 Set the Connection string property 
 Set the RecordSource property
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)
Demo – Setting up a Data Source Name
Example of a File DSN (Standard) 
[ODBC] 
DRIVER=SQL Server 
UID=sa 
DATABASE=StateU 
WSID=DALGOODWIN3 
APP=Microsoft® Access 
SERVER=dalgoodwin3
Example of a File DSN (Integrated) 
[ODBC] 
DRIVER=SQL Server 
UID=tgoodwin 
Trusted_Connection=Yes 
DATABASE=pubs 
WSID=DALGOODWIN3 
APP=Microsoft Open Database Connectivity 
SERVER=DALGOODWIN3DALGOODWIN32000
DEMO – ADO Control with DSN
Connecting with ADO Data Control 
(UDL) 
 Natively it connects fine 
 It’s ADO 
 Set the Connection string property 
 Set the RecordSource property
Creating a UDL 
 Create a file with a .UDL extention. 
 Double-click on the icon.
Set the Provider
Set the Connection and Test
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=dalgoodwin3dalgoodwin32000 
Look familiar? 
Can you say “Connection string”
DEMO – ADO Control with UDL
Connecting with ADO (Programmatically) 
 Declare an ADO connection object 
 Set the Connection String 
 Open the Connection 
 Instantiate the recordset etc….
DEMO – Connect with ADO
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.
Summary 
 We discussed establishing an connection to a 
SQL Server Database. 
 We learned that there is an easy way and a 
hard way 
 Questions?

More Related Content

PPT
ASP.NET Session 11 12
PPTX
PPT
ADO.NET
PPTX
Database connectivity to sql server asp.net
PPTX
Web Technologies - forms and actions
PPT
Php Data Objects
PDF
ASP.NET Session 11 12
ADO.NET
Database connectivity to sql server asp.net
Web Technologies - forms and actions
Php Data Objects

What's hot (20)

PPT
Dealing with SQL Security from ADO.NET
PPT
ASP.NET 09 - ADO.NET
PPTX
Learn PHP Lacture2
PDF
Ext GWT 3.0 Data Widgets
PPTX
ADO.NET -database connection
PDF
Ado.Net
PPT
Ado.net
DOCX
Accessing data with android cursors
PPTX
Chapter 3: ado.net
PDF
Ado.Net Architecture
PPTX
Mdst 3559-03-01-sql-php
PPT
Ado.net
PPT
Simple Data Binding
PDF
Jdbc 1
PPTX
Ado .net
PDF
Green dao 3.0
DOCX
ODI User and Security
ZIP
Introduction to SQLite in Adobe AIR 1.5
PPTX
Database Basics and MySQL
Dealing with SQL Security from ADO.NET
ASP.NET 09 - ADO.NET
Learn PHP Lacture2
Ext GWT 3.0 Data Widgets
ADO.NET -database connection
Ado.Net
Ado.net
Accessing data with android cursors
Chapter 3: ado.net
Ado.Net Architecture
Mdst 3559-03-01-sql-php
Ado.net
Simple Data Binding
Jdbc 1
Ado .net
Green dao 3.0
ODI User and Security
Introduction to SQLite in Adobe AIR 1.5
Database Basics and MySQL
Ad

Viewers also liked (16)

PDF
OPAH en vallée d'Aure et du Louron
PPTX
Como corregir tu estilo guías
PPTX
Digital toolbox for_science_assessment
PPTX
Adopt a tree
PDF
Arriba en llamas 01
PPS
大陸風景
DOCX
Silabus pgsd 2011
PDF
Apartes de la Conferencia de la SJG del 14 y 21 de Enero de 2012:Luminosity f...
PDF
Life Begins at 40: 6 lessons we shouldn't forget from our 40 years of gaming ...
PDF
Superheroes SXSW 2013
PDF
Animation du 27 septembre au 12 octobre 2014 (1)
PPT
2010-03-31 - VU Amsterdam - Experiences testing safety critical systems
PPTX
Celtic holidays in the usa
PPSX
I16 Intelligent Keypad
OPAH en vallée d'Aure et du Louron
Como corregir tu estilo guías
Digital toolbox for_science_assessment
Adopt a tree
Arriba en llamas 01
大陸風景
Silabus pgsd 2011
Apartes de la Conferencia de la SJG del 14 y 21 de Enero de 2012:Luminosity f...
Life Begins at 40: 6 lessons we shouldn't forget from our 40 years of gaming ...
Superheroes SXSW 2013
Animation du 27 septembre au 12 octobre 2014 (1)
2010-03-31 - VU Amsterdam - Experiences testing safety critical systems
Celtic holidays in the usa
I16 Intelligent Keypad
Ad

Similar to Sql server classes in mumbai (20)

DOCX
Ado dot net complete meterial (1)
PPTX
Ch06 ado.net fundamentals
PPTX
Ado.net
PPT
Chapter 4 event it theory programming.pptx
PPT
ADO .Net
PPTX
Is2215 lecture7 lecturer_ado_intro
PPTX
Connected data classes
DOCX
unit 3.docx
PPTX
PPT temp.pptx
PPT
Final Database Connectivity in JAVA.ppt
PPT
Introduction to ado
PPTX
Ado.Net Tutorial
PPTX
PATTERNS07 - Data Representation in C#
PDF
PPTX
Advance Java Programming (CM5I)5.Interacting with-database
PPTX
6 database
PPT
jdbc_presentation.ppt
PPT
Introduction to ado.net
PPT
Database Basics Taac 2005
PPTX
Ch 7 data binding
Ado dot net complete meterial (1)
Ch06 ado.net fundamentals
Ado.net
Chapter 4 event it theory programming.pptx
ADO .Net
Is2215 lecture7 lecturer_ado_intro
Connected data classes
unit 3.docx
PPT temp.pptx
Final Database Connectivity in JAVA.ppt
Introduction to ado
Ado.Net Tutorial
PATTERNS07 - Data Representation in C#
Advance Java Programming (CM5I)5.Interacting with-database
6 database
jdbc_presentation.ppt
Introduction to ado.net
Database Basics Taac 2005
Ch 7 data binding

More from Vibrant Technologies & Computers (20)

PPT
Buisness analyst business analysis overview ppt 5
PPT
SQL Introduction to displaying data from multiple tables
PPT
SQL- Introduction to MySQL
PPT
SQL- Introduction to SQL database
PPT
ITIL - introduction to ITIL
PPT
Salesforce - Introduction to Security & Access
PPT
Data ware housing- Introduction to olap .
PPT
Data ware housing - Introduction to data ware housing process.
PPT
Data ware housing- Introduction to data ware housing
PPT
Salesforce - classification of cloud computing
PPT
Salesforce - cloud computing fundamental
PPT
SQL- Introduction to PL/SQL
PPT
SQL- Introduction to advanced sql concepts
PPT
SQL Inteoduction to SQL manipulating of data
PPT
SQL- Introduction to SQL Set Operations
PPT
Sas - Introduction to designing the data mart
PPT
Sas - Introduction to working under change management
PPT
SAS - overview of SAS
PPT
Teradata - Architecture of Teradata
PPT
Teradata - Restoring Data
Buisness analyst business analysis overview ppt 5
SQL Introduction to displaying data from multiple tables
SQL- Introduction to MySQL
SQL- Introduction to SQL database
ITIL - introduction to ITIL
Salesforce - Introduction to Security & Access
Data ware housing- Introduction to olap .
Data ware housing - Introduction to data ware housing process.
Data ware housing- Introduction to data ware housing
Salesforce - classification of cloud computing
Salesforce - cloud computing fundamental
SQL- Introduction to PL/SQL
SQL- Introduction to advanced sql concepts
SQL Inteoduction to SQL manipulating of data
SQL- Introduction to SQL Set Operations
Sas - Introduction to designing the data mart
Sas - Introduction to working under change management
SAS - overview of SAS
Teradata - Architecture of Teradata
Teradata - Restoring Data

Recently uploaded (20)

PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
Introduction to pro and eukaryotes and differences.pptx
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
Hazard Identification & Risk Assessment .pdf
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
Education and Perspectives of Education.pptx
PDF
My India Quiz Book_20210205121199924.pdf
PDF
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
PDF
International_Financial_Reporting_Standa.pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Paper A Mock Exam 9_ Attempt review.pdf.
Introduction to pro and eukaryotes and differences.pptx
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Virtual and Augmented Reality in Current Scenario
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Hazard Identification & Risk Assessment .pdf
B.Sc. DS Unit 2 Software Engineering.pptx
Education and Perspectives of Education.pptx
My India Quiz Book_20210205121199924.pdf
LIFE & LIVING TRILOGY - PART (3) REALITY & MYSTERY.pdf
What if we spent less time fighting change, and more time building what’s rig...
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
Share_Module_2_Power_conflict_and_negotiation.pptx
LEARNERS WITH ADDITIONAL NEEDS ProfEd Topic
Cambridge-Practice-Tests-for-IELTS-12.docx
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 1).pdf
International_Financial_Reporting_Standa.pdf

Sql server classes in mumbai

  • 2. Connecting to Microsoft SQL Server Presented By K1/ 4, Second floor, Sector-15/ 16 Market, Vashi, Navi Mumbai. Contact : 9892900103 / 9892900173 wwwwww..vviibbrraanntttteecchhnnoollooggiieess..ccoo..iinn
  • 3. 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.
  • 4. Agenda  Overview – What do you have to know…  Security Modes  Database Interfaces  Connecting to a SQL Server Data Source
  • 5. Overview – What do you have to know… 1. Server Name 2. Security Information 3. Database name 4. Data Interface / API to use 5. Steps to connect…
  • 6. Security Modes There are two types of modes:  Standard Mode (default)  Integrated Mode CLIENT SQL SERVER Standard and Integrated Security DATABASE Database Security Users, Groups, Permissions
  • 7. Database Interfaces OLE DB DB-ODBC Library Data Object Interfaces Application Programming Interfaces ADO RDO VBSQL DAO JET Relational Databases Other Data Sources
  • 8. 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)
  • 9. Connecting with Data Control  Natively it can’t be done…  It uses DAO.  However…  If a Jet Database has already connected to a SQL Server database, then we can connect to that.  Downside  We’re indirectly connecting (through JET)  Probably not the most efficient way.  DEMO
  • 10. Connecting with ADO Data Control (ADO)  Natively it connects fine  It’s ADO  Set the Connection string property  Set the RecordSource property  DEMO
  • 11. Connecting with ADO Data Control (DSN)  Natively it connects fine  It’s ODBC  Set the Connection string property  Set the RecordSource property
  • 12. 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)
  • 13. Demo – Setting up a Data Source Name
  • 14. Example of a File DSN (Standard) [ODBC] DRIVER=SQL Server UID=sa DATABASE=StateU WSID=DALGOODWIN3 APP=Microsoft® Access SERVER=dalgoodwin3
  • 15. Example of a File DSN (Integrated) [ODBC] DRIVER=SQL Server UID=tgoodwin Trusted_Connection=Yes DATABASE=pubs WSID=DALGOODWIN3 APP=Microsoft Open Database Connectivity SERVER=DALGOODWIN3DALGOODWIN32000
  • 16. DEMO – ADO Control with DSN
  • 17. Connecting with ADO Data Control (UDL)  Natively it connects fine  It’s ADO  Set the Connection string property  Set the RecordSource property
  • 18. Creating a UDL  Create a file with a .UDL extention.  Double-click on the icon.
  • 20. Set the Connection and Test
  • 21. 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=dalgoodwin3dalgoodwin32000 Look familiar? Can you say “Connection string”
  • 22. DEMO – ADO Control with UDL
  • 23. Connecting with ADO (Programmatically)  Declare an ADO connection object  Set the Connection String  Open the Connection  Instantiate the recordset etc….
  • 24. DEMO – Connect with ADO
  • 25. 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.
  • 26. Summary  We discussed establishing an connection to a SQL Server Database.  We learned that there is an easy way and a hard way  Questions?

Editor's Notes

  • #6: When creating a connection, you can use one of three sources: a Connection String, an OLE DB file (.UDL), or an ODBC Data Source Name (DSN). When using a DSN, it's likely you will not have to alter any of the other properties of the control. If you have created a Microsoft Data Link file (.UDL), select Use OLE DB File and click Browse to find the file on the computer. If you use a DSN, click Use ODBC Data Source Name and select a DSN from the box, or click New to create one. If you wish to use create a connection string, select Use ConnectionString, and then click Build, and use the Data Link Properties dialog box to create a connection string. After creating the connection string, click OK. The ConnectionString property will be filled with a string like: driver={SQL Server};server=bigsmile;uid=sa;pwd=pwd;database=pubs
  • #7: Standard Security is the default security Mode for SQL Server. When this mode is in use, the user must enter a login ID and password that have been established for the database. Integrated security allows SQL Server to use Windows authentication. With integrated security, users maintain a single login and password for both Windows NT/2000/XP and SQL Server.
  • #8: ODBC is the native Interface to SQL Server. It allows you to connect to relational databases only. There are many ODBC driver available for the different relational databases on the market. OLE DB is a COM based low-level interface that will be abstracted for the programmer. It is the preferred database interface and is not limited to connecting to only relational data. DB-Llibrary is a proprietary, legacy data access API for SQL Server. It is somewhat cumbersome and difficult to program.
  • #15: DSN-less Connections You can open a connection to a database without creating or specifying a named data source. Connections made in this way are called DSN-less, because they don’t require the system administrator to create an ODBC DSN. Rather than relying on information stored in a file or in the system registry, DSN-less connections specify the driver name, and all driver-specific information in the connection string. Whether or not to use a DSN depends on how much flexibility you want. Connection parameters are readily visible to system administrators. As a result, no matter which connection style you use, there are no extra security benefits. Probably the most common reason for using a DSN-less connection is to connect to a database on a system that is not under your direct control. This makes DSN-less connections good for testing and for applications under development. The following DSN-less connection strings contain the minimum parameters required by the ODBC drivers of Access and SQL 6.5: strConAccess = "Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\db.mdb" strConSQL = "Driver={SQL Server};Server=(local);UID=sa;PWD=" Essentially, a DSN-less connection is hard-coded to use a certain driver, user identity, and network location, which makes it bothersome and difficult to update when the database parameters change. Because the variety of connection parameters can differ greatly from one ODBC data source drive to another, it is recommended that you use a DSN whenever possible.