简体   繁体   中英

Paste VBA recordset into excel?

如果我在VBA中返回了一个SQL记录集,是否有一种简单的方法就可以将值粘贴到电子表格中而无需循环执行等?

If you are using "Oracle InProc Server" and OraDynaset you would use something like the following snippet.

Dim QueryResults As OraDynaset
Set QueryResults = Label_DB.CreateDynaset(SQL_String, 0&)
QueryResults.CopyToClipboard
Selection.Paste

The default behaviour for CopyToClipboard is to place TAB (ASCII 9) as the column separator and ENTER (ASCII 13) as the row separator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM