ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

½Ð±ÐVBA SQL»yªk¤ºªº¤u§@ªí,¥i§_¥ÎÅܼƥN´À?

½Ð±ÐVBA SQL»yªk¤ºªº¤u§@ªí,¥i§_¥ÎÅܼƥN´À?

Set myCon = CreateObject("ADODB.Connection")
    myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;Data Source=" & ThisWorkbook.FullName
    Sql = "SELECT * FROM [His$]"

His ¬O¤u§@ªí¦WºÙ, His ¯à§_¥ÎÅܼƥN´À?
·PÁ«ü±Ð...

¦^´_ 1# newsoft
  1. Option Explicit
  2. Sub Ex()
  3.     Dim myCon As Object, Sql As String, Sh_Name As String
  4.     Set myCon = CreateObject("ADODB.Connection")
  5.     myCon.Open "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Excel 8.0;Data Source=" & ThisWorkbook.FullName
  6.     Sh_Name = ThisWorkbook.Sheets(1).Name  '
  7.     Sql = "SELECT * FROM [" & Sh_Name & "$]"

  8. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : Ä@­n¤j¡B§Ó­n°í¡B®ð­n¬X¡B¤ß­n²Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD