Table of contents
TOC
Recolher sumário
Expandir sumário

Execute Method (ADO Connection)Execute Method (ADO Connection)

office 365 dev account|Última Atualização: 03/04/2018
|
1 Colaborador

Aplica-se ao: Access 2013 | Access 2016Applies to: Access 2013 | Access 2016

Neste artigosintaxeRetornar valorparâmetroscomentáriosIn this articleSyntaxReturn ValueParametersRemarks

Executes the specified query, SQL statement, stored procedure, or provider-specific text.Executes the specified query, SQL statement, stored procedure, or provider-specific text.

SintaxeSyntax

For a non-row-returning command string:For a non-row-returning command string:

For a row-returning command string:For a row-returning command string:

Valor de RetornoReturn Value

Returns a Recordset object reference.Returns a Recordset object reference.

ParametersParameters

  • CommandTextCommandText

  • Um valor String que contém a instrução SQL, procedimento armazenado, uma URL ou texto específico do provedor para executar.A String value that contains the SQL statement, stored procedure, a URL, or provider-specific text to execute.Optionally, table names can be used but only if the provider is SQL aware.Optionally, table names can be used but only if the provider is SQL aware.For example if a table name of "Customers" is used, ADO will automatically prepend the standard SQL Select syntax to form and pass "SELECT * FROM Customers" as a T-SQL statement to the provider.For example if a table name of "Customers" is used, ADO will automatically prepend the standard SQL Select syntax to form and pass "SELECT * FROM Customers" as a T-SQL statement to the provider.

  • RecordsAffectedRecordsAffected

  • Optional.Optional.Uma variável Long ao qual o provedor retorna o número de registros que que a operação afetados.A Long variable to which the provider returns the number of records that the operation affected.

  • OptionsOptions

  • Optional.Optional.Um valor Long que indica como o provedor deverá avaliar o argumento CommandText .A Long value that indicates how the provider should evaluate the CommandText argument.Can be a bitmask of one or moreCommandTypeEnum orExecuteOptionEnum values.Can be a bitmask of one or moreCommandTypeEnum orExecuteOptionEnum values.

Observação Use o valor de ExecuteOptionEnumadExecuteNoRecords para melhorar o desempenho, minimizando interno de processamento.Note Use the ExecuteOptionEnum value adExecuteNoRecords to improve performance by minimizing internal processing.

Não use os valores CommandTypeEnum de adCmdTableDirect ou de adCmdFile com Executar.Do not use the CommandTypeEnum values of adCmdFile or adCmdTableDirect with Execute.These values can only be used as options with theOpen andRequery methods of a Recordset.These values can only be used as options with theOpen andRequery methods of a Recordset.

RemarksRemarks

Usando o método Execute em um objeto deConexão executa qualquer consulta que você passa para o método no argumento CommandText sobre a conexão especificada.Using the Execute method on aConnection object executes whatever query you pass to the method in the CommandText argument on the specified connection.Se o argumento CommandText Especifica uma consulta retorne linhas, quaisquer resultados que gera a execução são armazenados em um novo objeto Recordset .If the CommandText argument specifies a row-returning query, any results that the execution generates are stored in a new Recordset object.If the command is not intended to return results (for example, an SQL UPDATE query) the provider returns Nothing as long as the option adExecuteNoRecords is specified; otherwise Execute returns a closed Recordset.If the command is not intended to return results (for example, an SQL UPDATE query) the provider returns Nothing as long as the option adExecuteNoRecords is specified; otherwise Execute returns a closed Recordset.

O objeto Recordset retornado é sempre um cursor somente leitura, somente de encaminhamento.The returned Recordset object is always a read-only, forward-only cursor.If you need a Recordset object with more functionality, first create a Recordset object with the desired property settings, then use the Recordset object'sOpen method to execute the query and return the desired cursor type.If you need a Recordset object with more functionality, first create a Recordset object with the desired property settings, then use the Recordset object'sOpen method to execute the query and return the desired cursor type.

O conteúdo do argumento CommandText é específico do provedor e pode ser uma sintaxe SQL padrão ou qualquer formato especial de comando que o provedor oferece suporte.The contents of the CommandText argument are specific to the provider and can be standard SQL syntax or any special command format that the provider supports.

An ExecuteComplete event will be issued when this operation concludes.An ExecuteComplete event will be issued when this operation concludes.

Observação URLs usando o esquema http automaticamente invocará o Microsoft OLE DB Provider for Internet Publishing.Note URLs using the http scheme will automatically invoke the Microsoft OLE DB Provider for Internet Publishing.For more information, see Absolute and Relative URLs.For more information, see Absolute and Relative URLs.

RECURSOS DE SUPORTE DO ACCESSACCESS SUPPORT RESOURCES
Fórum do Access para desenvolvedores no MSDNAccess for developers forum on MSDN
Ajuda do Access em support.office.comAccess help on support.office.com
Ajuda do Access em answers.microsoft.comAccess help on answers.microsoft.com
Procure erros de código específicos do Access no BingSearch for specific Access error codes on Bing
Fóruns do Access no UtterAccessAccess forums on UtterAccess
Wiki do Access no UtterAcessAccess wiki on UtterAcess
Central de ajuda da programação VBA e desenvolvedor do Access (FMS)Access developer and VBA programming help center (FMS)
Postagens do Access no StackOverflowAccess posts on StackOverflow

© 2018 Microsoft