Identificativo articolo: 120870 - Ultima modifica: martedì 16 agosto 2005 - Revisione: 1.1 XL: Panoramica funzioni di componente aggiuntivo ODBC e argomentiSommarioNelle versioni di Microsoft Excel elencate all'inizio di questo articolo, il componente aggiuntivo ODBC XLODBC.XLA fornisce funzioni di ODBC (Open Database Connectivity) che consentono di connettersi direttamente a origini dati esterne. XLODBC.XLA fornisce funzioni di Visual Basic per applicazioni e Microsoft Excel 4.0 linguaggi macro. Tutte le funzioni sono i comandi delle macro ad eccezione di SQL.Request e SqlRequest, che sono funzioni del foglio di lavoro. Nota: Le funzioni di SQLBind, SQLClose, SQLError, SQLExec, SQLGetSchema, la funzione SQLOpen, SQLRetrieve e SQLRetrieveToFile vengono visualizzate nella creazione guidata funzione quando il foglio attivo è un foglio di lavoro. Tuttavia, queste funzioni possono essere utilizzate solo in un foglio macro o modulo. InformazioniDi seguito è riportato un elenco delle funzioni fornite da XLODBC.XLA e una descrizione degli argomenti per quelle funzioni. Vengono visualizzati gli argomenti per ogni funzione qui così come sono visualizzati nella creazione guidata funzione. Si noti che nelle convenzioni di denominazione argomento utilizzate tra la creazione guidata funzione e i file della Guida sono alcune differenze. SQL.BIND(connection_num,column,reference) SQLBind(ConnectionNum,Column,Reference) SQL.CLOSE(connection_num) SQLClose(ConnectionNum) SQL.ERROR() SQLError() SQL.EXEC.QUERY(connection_num,query_text) SQLExecQuery(ConnectionNum,QueryText) SQL.GET.SCHEMA(connection_num,type_num,qualifier_text) SQLGetSchema(ConnectionNum,TypeNum,QualifierText) SQL.OPEN(connection_string,output_ref,driver_prompt) SQLOpen(ConnectionStr,OutputRef,DriverPrompt) SQL.REQUEST(connection_string,output_ref,driver_prompt,query_text,col_ names_logical) SQLRequest(ConnectionStr,QueryText,OutputRef,DriverPrompt,ColNamesLogi cal) SQL.RETRIEVE(connection_num,destination_ref,max_columns,max_rows, col_names_logical,row_nums_logical,named_rng_logical,fetch_first_logica l) SQLRetrieve(ConnectionNum,DestinationRef,MaxColumns,MaxRows, ColNamesLogical,RowNumsLogical,NamedRngLogical,FetchFirstLogical) SQL.RETRIEVE.TO.FILE(connection_num,destination,col_names_logical, column_delimiter) SQLRetrieveToFile(ConnectionNum,Destination,ColNamesLogical, ColumnDelimiter) Nota: L'ordine degli argomenti della funzione di Microsoft Excel 4.0 SQL.Request differisce da quello della funzione SQLRequest Visual Basic. Nota: Anche se i nomi di argomento differiscono leggermente tra le funzioni di Microsoft Excel 4.0 macro e le funzioni di Visual Basic, gli argomenti stessi hanno lo stesso significato. Ad esempio, l'argomento di ConnectionNum per una funzione Visual Basic ha lo stesso significato di connection_num per una funzione nel linguaggio macro di Microsoft Excel versione 4.0. Di seguito è riportato una descrizione degli argomenti utilizzati nelle funzioni sopra: Argument Description ---------------------------------------------------------------------
ColNamesLogical True if you want column names returned as the
col_names_logical first row of the results.
Column The number of the result column to be bound.
column Result columns are numbered from left to right
starting with 1. Column 0 provides row numbers.
If you omit column, all bindings for the
connection are removed.
ColumnDelimiter The string to use to separate the elements in
column_delimiter each row of the created text file. If omitted,
a tab is used.
ConnectionNum The unique ID returned by SQLOpen for the
connection_num connection made to the data source.
ConnectionStr Supplies information, such as the data source
connection_string name, user ID, and password, required by the
driver being used to connect to a data source.
Must follow the driver's format (see the
"References" section of this article for
information about where the driver's help file is
located). Strings longer than 255 characters must
be broken into an array of strings.
Destination A string that specifies the name and path of
destination the file where you want to place the results.
An existing file will be overwritten.
DestinationRef A reference specifying the top-left cell where
destination_ref results should be placed. Any previous values
in the destination cells are overwritten
without confirmation. If omitted, results are
placed according to previous calls to SQLBind.
DriverPrompt A number specifying if and how the driver should
driver_prompt prompt for additional needed information for a
connection. Refer to the online help for values.
FetchFirstLogical Important only if MaxRows is specified for
fetch_first_logical SQLRetrieve, and there are more rows of results
than MaxRows available. Use True to return
the first set of rows from the beginning of a
query's results. Then call SQLRetrieve repeatedly
using False to return the next set of rows until
all result rows are returned. Refer to the online
help for details.
MaxColumns The maximum number of columns to be returned to
max_columns the worksheet starting at DestinationRef.
If omitted, all columns are returned.
MaxRows The maximum number of rows to be returned to
max_rows the worksheet starting at DestinationRef.
If omitted, all rows are returned.
NamedRngLogical True if you want each column of the results to
named_rng_logical be declared as a named range on the worksheet.
OutputRef A cell reference where you want the completed output_ref connection string placed. QualifierText A string that qualifies the information returned qualifier_text by TypeNum--only for a TypeNum of 3, 4, or 5.
QueryText The SQL query to be executed on the data source.
query_text Strings longer than 255 characters must be broken
into an array of strings. While common queries use
a standard syntax, there may be differences in
driver limitations and extensions (see the
"References" section of this article for
information about where the driver's help file is
located).
Reference The location of a single cell on a worksheet where
reference you want the results bound as a Range object.
If Reference is omitted, binding is removed for
the column.
RowNumsLogical Used only when destination is included in the
row_nums_logical function call. If rowNumbers is True, the
first column in the result set contains row
numbers. If destination is False or omitted,
the row numbers are not returned.
TypeNum Specifies the type of information you want
type_num returned. Refer to the online help for values.
RiferimentiPer ulteriori informazioni sulle singole funzioni, vedere il file della Guida appropriato. Se si utilizza Microsoft Windows, i file della Guida del driver ODBC trovano nella directory Windows\System e sono denominati DRVXXXXX.HLP. Se si utilizza un computer Macintosh, i file della Guida per i driver Microsoft ODBC sono nella cartella Microsoft e vengono chiamati "ODBC SQL Server Guida" e "D + E ODBC FoxPro Driver Guida". "Dell'utente di Microsoft Excel 5.0 Guide", capitolo 23. Le informazioni in questo articolo si applicano a:
Traduzione automatica articoliIl presente articolo è stato tradotto tramite il software di traduzione automatica di Microsoft e non da una persona. Microsoft offre sia articoli tradotti da persone fisiche sia articoli tradotti automaticamente da un software, in modo da rendere disponibili tutti gli articoli presenti nella nostra Knowledge Base nella lingua madre dell?utente. Tuttavia, un articolo tradotto in modo automatico non è sempre perfetto. Potrebbe contenere errori di sintassi, di grammatica o di utilizzo dei vocaboli, più o meno allo stesso modo di come una persona straniera potrebbe commettere degli errori parlando una lingua che non è la sua. Microsoft non è responsabile di alcuna imprecisione, errore o danno cagionato da qualsiasi traduzione non corretta dei contenuti o dell?utilizzo degli stessi fatto dai propri clienti. Microsoft, inoltre, aggiorna frequentemente il software di traduzione automatica. Clicca qui per visualizzare la versione originale in inglese dell?articolo: 120870
(http://support.microsoft.com/kb/120870/en-us/
)
LE INFORMAZIONI CONTENUTE NELLA MICROSOFT KNOWLEDGE BASE SONO FORNITE SENZA GARANZIA DI ALCUN TIPO, IMPLICITA OD ESPLICITA, COMPRESA QUELLA RIGUARDO ALLA COMMERCIALIZZAZIONE E/O COMPATIBILITA' IN IMPIEGHI PARTICOLARI. L'UTENTE SI ASSUME L'INTERA RESPONSABILITA' PER L'UTILIZZO DI QUESTE INFORMAZIONI. IN NESSUN CASO MICROSOFT CORPORATION E I SUOI FORNITORI SI RENDONO RESPONSABILI PER DANNI DIRETTI, INDIRETTI O ACCIDENTALI CHE POSSANO PROVOCARE PERDITA DI DENARO O DI DATI, ANCHE SE MICROSOFT O I SUOI FORNITORI FOSSERO STATI AVVISATI. IL DOCUMENTO PUO' ESSERE COPIATO E DISTRIBUITO ALLE SEGUENTI CONDIZIONI: 1) IL TESTO DEVE ESSERE COPIATO INTEGRALMENTE E TUTTE LE PAGINE DEVONO ESSERE INCLUSE. 2) I PROGRAMMI SE PRESENTI, DEVONO ESSERE COPIATI SENZA MODIFICHE, 3) IL DOCUMENTO DEVE ESSERE DISTRIBUITO INTERAMENTE IN OGNI SUA PARTE. 4) IL DOCUMENTO NON PUO' ESSERE DISTRIBUITO A SCOPO DI LUCRO. | Traduzione articoli
|



Torna all'inizio
