Tutoriais ASP

ASP HOME

Tutorial WP

Introdução às páginas da Web Navalha de páginas da Web Layout de páginas da Web Pastas de páginas da Web Páginas da Web globais Formulários de páginas da Web Objetos de páginas da Web Arquivos de páginas da Web Bancos de dados de páginas da Web Assistentes de páginas da Web Páginas da Web WebGrid Gráficos de páginas da Web E-mail de páginas da Web Segurança de páginas da Web Publicação de páginas da Web Exemplos de páginas da Web Aulas de páginas da Web

Máquina de barbear ASP.NET

Introdução à navalha Sintaxe Razor Variáveis ​​Razor C# Loops Razor C# Razor C# Logic Variáveis ​​Razor VB Loops Razor VB Lógica do Razor VB

ASP Clássico

Introdução ASP Sintaxe ASP Variáveis ​​ASP Procedimentos ASP Condicionais ASP Loop ASP Formulários ASP Cookies ASP Sessão ASP Aplicativo ASP ASP #incluir ASP Global.asa ASP AJAX e-mail ASP Exemplos ASP

Referência ASP

Funções ASP VB Palavras-chave ASP VB Resposta ASP Solicitação ASP Aplicativo ASP Sessão ASP Servidor ASP Erro ASP Sistema de arquivos ASP Fluxo de texto ASP Unidade ASP Arquivo ASP Pasta ASP Dicionário ASP ASP AdRotator ASP BrowserCap Vinculação de conteúdo ASP Rotador de conteúdo ASP Referência Rápida ASP

Tutorial ADO

Introdução ao ADO ADO Connect Conjunto de registros ADO Exibição ADO Consulta ADO ADO Sort Adicionar ADO Atualização ADO Excluir ADO Demonstração ADO Aceleração ADO

Objetos ADO

Comando ADO Conexão ADO Erro ADO Campo ADO Parâmetro ADO Propriedade ADO Registro ADO Conjunto de registros ADO Fluxo ADO Tipos de dados ADO

Método Aberto ADO


❮ Referência Completa do Objeto de Registro

O método Open abre um objeto Record existente ou cria um novo arquivo ou diretório.

Sintaxe

Open(source,actconn,mode,createopt,opt,username,psword)

Parameter Description
source Optional. The source parameter may be one of the following:
  • An absolute url
  • A relative url
  • An open Recordset
  • Another Record object
  • A Command object
  • An SQL SELECT statement
  • A table name
actconn Optional. A connection string or a Connection object
mode Optional. A ConnectModeEnum value, that indicates the access mode of the Record object. Default is adModeUnknown
createopt Optional. A RecordCreateOptionsEnum value, that indicates whether an existing file/directory should be opened, or a new file/directory should be created. Default is adFailIfNotExists. This parameter will be ignored if the source parameter is not a URL
opt Optional. One or more RecordOpenOptionsEnum values, that specifies the options for opening the Record. Default is adOpenRecordUnspecified
username Optional. A user ID that authorizes access to source
psword Optional. A password that verifies the username

Exemplo

Example 1: source as the URL of a folder:

set rec = Server.CreateObject("ADODB.record")
rec.Open("https://www.w3schools.com/asp/")

Example 2: source as a relative URL in a Connection object:

set conn=Server.CreateObject("ADODB.Connection")
set rec = Server.CreateObject("ADODB.record")
conn.Open "URL=https://www.w3schools.com/asp/"
rec.Open("test.doc", conn)

Example 3: source as a row in a Recordset object:

set rs = Server.CreateObject("ADODB.recordset")
set rec = Server.CreateObject("ADODB.record")
rs.Open "test.doc", "URL=https://www.w3schools.com/asp/",,,adCmdTableDirect
rs.MoveLast() 
rec.Open(rs) 

Valores ConnectModeEnum

Constant Value Description
adModeUnknown 0 Default. Permissions have not been set or cannot be determined
adModeRead 1 Read-only
adModeWrite 2 Write-only
adModeReadWrite 3 Read/write
adModeShareDenyRead 4 Prevents others from opening a connection with read permissions
adModeShareDenyWrite 8 Prevents others from opening a connection with write permissions
adModeShareExclusive 12 Prevents others from opening a connection
adModeShareDenyNone 16 Allows others to open a connection with any permissions
adModeRecursive 0x400000 Used with adModeShareDenyNone, adModeShareDenyWrite, or adModeShareDenyRead to set permissions on all sub-records of the current Record

Valores RecordCreateOptionsEnum

Constant Value Description
adFailIfNotExists -1 Default. Fails if the source parameter points to a node that not exists
adCreateNonCollection 0 Creates a new Record of type adSimpleRecord
adCreateCollection 0x2000 Creates a new Record specified by the source parameter. If it points to an existing node, an error will occur. To prevent the error combine this value with adOpenIfExists or adCreateOverwrite
adOpenIfExists 0x2000000 If the source points to an existing node or Record object, then the provider must open the existing Record instead of creating a new one. This value cannot be used with adCreateOverwrite
adCreateOverwrite 0x4000000 If the source points to an existing node or Record, then the existing Record will be overwritten and a new one is created in its place. This value cannot be used with adOpenIfExists
adCreateStructDoc 0x80000000 Creates a new Record of type adStructDoc

Valores RecordOpenOptionsEnum

Constant Value Description
adOpenRecordUnspecified -1 Default. No options are specified
adOpenAsync 0x1000 Opens the Record object in asynchronous mode
adDelayFetchStream 0x4000 The default stream associated with the Record need not be retrieved initially
adDelayFetchFields 0x8000 The fields associated with the Record need not be retrieved initially, but can be retrieved at the first attempt to access the field
adOpenExecuteCommand 0x10000 The source contains command text that should be executed
adOpenOutput 0x800000 If the source points to a node that contains an executable script, then the opened Record will contain the results of the executed script. This value is only valid with non-collection records

❮ Referência Completa do Objeto de Registro