ADO TutorialLesson 62Free preview
ADO Connect
This lesson is part of ASP · All levels
Summary
Opening a database connection with ADO starts by creating an object ADODB.Connection and then calling the Open method with a connection string. Connection strings contain providers and data source locations, such as Access or SQL Server. Once the operation is complete, the mandatory connection is closed and the object is released so that the server resources are not depleted.
Key points
- Objects are created with Server.CreateObject("ADODB.Connection").
- The connection string contains the provider, the data source, and the authentication options.
- The connection opens with conn.Open and closes with conn.Close.
- Use parametric queries, don't mix user input into the SQL string.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.