¦p¦ó§âEXCEL¸ê®Æ¿é¤J¨ìAccess
- ©«¤l
- 1
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 3
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN 7
- ³nÅ骩¥»
- OFFICE 2016
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-5-23
- ³Ì«áµn¿ý
- 2020-7-12
|
¦p¦ó§âEXCEL¸ê®Æ¿é¤J¨ìAccess
¦U¦ì¤j¤j§Ú¥ÎEXCEL VB¼g¤Fµ{¦¡«á¡A¤£À´«ç»ò§âAccess·í§@EXCELªºDB¡A¸Ó¦p¦ó±NEXCEL¸ê®Æ¦Û°Ê©ß¨ìACCESS
·P®¦ |
|
hello
|
|
|
|
|
- ©«¤l
- 471
- ¥DÃD
- 121
- ºëµØ
- 0
- ¿n¤À
- 579
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN10
- ³nÅ骩¥»
- OFFICE2019
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2015-4-16
- ³Ì«áµn¿ý
- 2023-1-17
|
|
|
|
|
|
|
- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2018-1-2 06:15 ½s¿è
¦^´_ 1# tsengs
´£¨Ñ§A°Ñ¦Ò¡G- Option Explicit
- ' ACCDB ª©
- Option Base 1
- ' Dim cnn As Object ' New ADODB.Connection
- ' Dim cmd As Object ' New ADODB.Command
- ' Dim rs As Object ' New ADODB.Recordset
- Dim cnn As ADODB.Connection, rs As ADODB.Recordset, cmd As ADODB.Command
- Dim strSQL As String
- Dim editMode As Boolean
- Public dic3 As Object ' ¦b ThisWorkbook ¤Þ¥Î¡A¦¹³Bn«Å§i Public
- ' ³]©w¤Þ¥Î¶µ¥Ø - VBAProject -> ¥i¤Þ¥Îªº¶µ¥Ø (A)¡G
- ' Visual Basic For Applications
- ' Microsoft Excel 14.0 Object Library
- ' OLE Automation
- ' Microsoft Office 14.0 Object Library
- ' Microsoft Forms 2.0 Object Library
- ' Microsoft DAO 3.6 Object Library
- ' Microsoft ADO Ext 6.0 for DDL and Security
- ' Microsoft ActiveX Data Object 6.1 Library
- Sub OpenDB()
- Set cnn = New ADODB.Connection
- Set rs = New ADODB.Recordset
- Set cmd = New ADODB.Command
- ' ObjectStateEnum Values
- ' Returns a value describing if the connection is open or closed
- ' Specifies whether an object is open or closed, connecting to a data source,
- ' executing a command, or retrieving data.
- ' --------------------------------------------------------------------------
- ' Constant Value Description
- ' --------------------------------------------------------------------------
- ' adStateClosed 0 The object is closed
- ' adStateOpen 1 The object is open
- ' adStateConnecting 2 The object is connecting
- ' adStateExecuting 4 The object is executing a command
- ' adStateFetching 8 The rows of the object are being retrieved
- With cnn
- If .State = 1 Then .Close ' adStateOpen
-
- ' .ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & _
- ' ThisWorkbook.Path & Application.PathSeparator & "°O¿ý©ú²Óªí.mdb" & ";"
- ' For Microsoft.ACE.OLEDB.12.0,you need Microsoft Office 12.0 Access Database Engine to be installed.
- .ConnectionString = "Provider=Microsoft.Ace.OLEDB.12.0;" & "Data Source=" & _
- ThisWorkbook.Path & Application.PathSeparator & "°O¿ý©ú²ÓªíÀÉ®×.accdb" & ";"
- .Open
- End With
- End Sub
- Sub closeRS()
- With rs
- If .State = 1 Then .Close ' adStateOpen
- ' The CursorLocation property is used to set or return the location of the cursor.
- ' This property can be set to one of the CursorLocationEnum constants listed in the following table.
- ' Enumeratio0n Value Description
- ' adUseNone 1 This value indicates no cursor location.
- ' This value is not supported by the MicrosoftR OLE DB Provider for AS/400 and VSAM.
- ' adUseServer 2 This value indicates that the data provider or driver-supplied cursor is used.
- ' adUseClient 3 This value indicates that a client-side cursor supplied by a local cursor library
- ' is to be used.
- ' adUseClientBatch 3 For backward compatibility, this value indicates that a client-side cursor supplied by
- ' a local cursor library is to be used.
- .CursorLocation = 3 ' adUseClient
- End With
- End Sub
½Æ»s¥N½X ´£°Ý°ÝÃD®É¡A½Ð¦P®É±N§Aªºªþ¥ó¤@¨Ö±a¤W¡A§_«h§Aªº´£°Ý·|¥Û¨I¤j®üªº¡C |
|
|
|
|
|
|
- ©«¤l
- 2
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 2
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- 2007
- ¾\ŪÅv
- 10
- µù¥U®É¶¡
- 2018-1-19
- ³Ì«áµn¿ý
- 2019-1-16
|
¸gADODB.Connection ¦Aª½±µ¥ÎSQL ±±¨îDB |
|
|
|
|
|
|
- ©«¤l
- 3
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 6
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- 7
- ¾\ŪÅv
- 10
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2018-7-21
- ³Ì«áµn¿ý
- 2022-2-16
|
¦^´_ 3# c_c_lai
½Ð°Ý¤j¤j¬O§_¦³ÀÉ®×¥i¨Ñ¤U¸üÆ[¼¯¡A·PÁÂ¥ý¡C |
|
|
|
|
|
|