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

¦p¦óÂ^¨ú¥XRecordsetªºTable Name

¦p¦óÂ^¨ú¥XRecordsetªºTable Name

½Ð±Ð¦U¦ì¤j¤j
¤£ª¾¹D¬O¦p¦³¿ëªk¥ÑADODB¤ºªºConnection©Î¬ORecordset¨Ó¨ú±o¥L­ì¥ý³s½uªºTable Name¬°¦ó©O¡H
clio

¦^´_ 1# clio
¸Õ¸Õ¬Ý
¤u¨ã-³]©w¤Þ¥Î¶µ¥Ø,¿ï¤¤ "Microsoft DAO3.6 Object Library¡¨
  1. Option Explicit
  2. Sub Ex()
  3.     Dim Da As DAO.Database, ta As DAO.TableDef
  4.     Set Da = DAO.OpenDatabase("¸ô®|\Database.mdb")
  5.     For Each ta In Da.TableDefs
  6.         If InStr(ta.Name, "MSys") = 0 Then Debug.Print ta.Name
  7.     Next
  8.     Da.Close
  9. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

Hi GBKEE,
§Ú¦b¸ü¤JMicrosoft DAO 3.6 Object Libaray®Éµo¥Í¿ù»~¡A¤£ª¾¹D¦³¤èªk¥i¥H¸Ñ¶Ü¡H
clio

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2018-2-7 07:00 ½s¿è

¦^´_ 1# clio
¦^´_ 2# GBKEE
GBKEE ª©¤j¡A·s¦~§Ö¼Ö¡I
¨BÆJ¤@¡G
¦b§Aªº C:\Program Files (x86)\Common Files\microsoft shared\DAO  §ä§ä¬Ý¬O§_¦³ DAO ¥Ø¿ý ? ¥B¤º¦³ Dao360.dll ¡H

¨BÆJ¤G¡G
±N¸Ó DAO ¥Ø¿ý¾ã­Ó½Æ»s¨ì C:\Program Files\Common Files\microsoft shared ¤º (°²³]§A¹q¸£¬O 64 ¦ì¤¸)

[©|¥¼µù¥U]
Type the following command: regsvr32 /u dao360.dll.
Hit ENTER. This will UN-REGISTER your file.

[­«·sµù¥U]
Type the following command: regsvr32 /i dao360.dll.
Hit ENTER. This will RE-REGISTER your file.

¨BÆJ¤T¡G
Ãö³¬©R¥O´£¥Ü¦r¤¸¡A¦A´ú¸Õ§Aªº°ÝÃD¡C
Close the command prompt window.

TOP

¦^´_ 3# clio

TOP

¦^´_ 4# c_c_lai

·PÁÂc_clai
¸g¹L±zªº§iª¾Àɮ׸ô®|«á¡A§Úª½±µ¦bExcel¸Ì­±«ü©w¸ô®|ªº¤è¦¡´N¯à§ì¨ú¤F¡A·PÁ±zªº¨ó§U¡C
clio

TOP

¦^´_ 2# GBKEE

Hi GBKEE,
·PÁ±zªº¨ó§U¡A§Ú¤]¸Õ¹L¤F¡A³o­Ó¬O§_¬Oµ¹Access¨Ï¥Î¡A¦]¬°¨º­Ó¸ô®|§Ú¤£²M·¡¡A©Ò¥H¸Õ¤£¥X¨Ó¡A
§Ú¬O¥ÎExcel¸Ì­±ªºVBA¥h§ìSQL©Î¬OORACLEµ¥¦h­ÓDatabase¡A¤@¶}©l¬O§â³s½u¨ìªº¸ê®ÆÂà¦^Recordset¡A¦A¨Ï¥ÎRecordset¨Ó°µ«áÄò§ä·j¤ñ¹ïªº¤u§@¡A
¦]¬°¦³·s¼W¤@­Ó¤u¯à¡A»Ý­n§@¥N¦³¸U¥Î¦r¤¸ªº¤ñ¹ï¡A©Ò¥HµLªk¨Ï¥ÎRecordset.Findªº¤èªk¨Ó§¹¦¨¡A¥u¦n»Ý­n­«·s³sµ²SQL©ÎORACLE¡AµM«á±qRecordsetªº¸ê°T¡A¦n¹³¤SµLªk§Ö³t±o¨ìTable Name
¤~·Q½Ð±Ð¤j¤j¡A¬O§_¦³§ó¦nªº¤èªk¡AÁÙ¬O§Ú¥u¯à±qRecordset.Sourceªº¦r¦ê¸ê°T¨ÓÂ^¨ú¶Ü¡H
¹ï¤£°_¥Ñ©ó§Ú¹ï³o¤è­±¤£¬O«Ü¤F¸Ñ¡A©Î³\·|°Ý¤F«Ü©_©Çªº°ÝÃD¡AÁٽШ£½Ì¡A·PÁ±z¡C
clio

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2018-2-7 11:04 ½s¿è

¦^´_ 7# clio
  1. Option Explicit
  2. '¤Þ¥Î¡GMicrosoft Ado Ext.2.x For DDL And Security
  3. Sub Ex_Ado()
  4.     Dim myCat As New ADOX.Catalog, myBook As String, i As Integer
  5.     Dim strUser As String, strPWD As String, Msg As String
  6.     myBook = "d:\excel\¸ê®Æ®w.xlsx"  '«ü©w­n¬d¸ßªº¤u§@粒¾ã¦WºÙ
  7.     Msg = UCase(Split(myBook, ".")(UBound(Split(myBook, "."))))
  8.     Select Case Msg  '«Ø¥ß»P«ü©w¤u§@Á¡ªº³s±µ
  9.         Case "XLS"
  10.             myCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" _
  11.             & "Extended Properties=Excel 8.0;" & "Data Source=" & myBook
  12.         Case Is = "XLSM", Is = "XLSX"
  13.             myCat.ActiveConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" _
  14.             & "Extended Properties=""Excel 12.0 xml"";" & "Data Source=" & myBook
  15.          Case "MDB"
  16.             myCat.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & myBook & _
  17.             ";User ID=" & strUser & ";Jet OLEDB:Database Password=""" & strPWD & """;"
  18.     End Select
  19.     Cells.Clear
  20.     Range("A1:B1") = Array("¬d¸ß¥Xªº¦WºÙ", "³B²z«áªº¦WºÙ")
  21.     With myCat.Tables
  22.         For i = 0 To .Count - 1
  23.             Cells(i + 2, 1) = .Item(i).Name
  24.           If Msg <> "MDB" Then Cells(i + 2, 2) = Mid(.Item(i).Name, 1, Len(.Item(i).Name) - 1)
  25.         Next
  26.     End With
  27. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 8# GBKEE

·PÁÂGBKEE¤j¤jªº¸Ñµª¡A§¹¥þ²Å¦X§Úªº»Ý¨D¡AÅý§Ú¸Ñ¨M¤F³o­Ó°ÝÃD¡A¥t¤@­Ó°ÝÃD¬O·Q½Ð±Ð¤@¤U
¤Þ¥Î¡GMicrosoft Ado Ext.2.x For DDL And Security
§Ú¸Ì­±¦³¬Ý¨ì¦³¤G­Ó¿ï¾Ü
Microsoft Ado Ext. 2.8 For DDL And Security
Microsoft Ado Ext. 6.0 For DDL And Security
¤£ª¾¹D³o¤GªÌªº®t²§¦b¨ºÃä©O¡H
clio

TOP

TOP

        ÀR«ä¦Û¦b : ¥Ç¿ù¥XÄb®¬¤ß¡A¤~¯à²M²bµL·Ð´o¡C
ªð¦^¦Cªí ¤W¤@¥DÃD