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

[µo°Ý] VBA ¥Îªí®æ¤º¬YÄæ¦ì¸ê®Æ¬d¸ßACCESS¸ê®Æ

¤£¦n·N«ä
¦pªG§t±K½Xªº¸Ü­n¥[¤°»ò?

TOP

'¤Þ¥Î ¢Ûicrosoft ActiveX Data Objects 2.x Library
Dim Cnnl As New ADODB.Connection '§A¬O¤£¬O§Ñ¤Fnew
Cnnl.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=D:\TEST.mdb; "
­Y¬O§Ú¦^µª¡A¨Ï±zº¡·N¡A½Ð±zÅý§Úª¾¹D¡I                  
­Y¬O§Úªº¦^ÂСA±z¤´¦³¨ä¥L¨£¸Ñ¡A¤]½Ð±z¤£¶Þ«ü±Ð¡I

TOP

¦^´_ 1# toxin

³o¦³¨â­Ó¤èªk¸Ñ¨M

1)    ¦bExcel ¢äBA ¨Ï¥Î¨ì¡@ADO¡@«e¥ý´O¤J¡@¢ÏDO Library
¨ä°µªk¬°¦bVBA½s¿è¾¹¤¤, ¨Ï¥Î ¤u¨ã¡Ö³]©w¤Þ¥Î¶µ¥Ø
³o¼Ë·|±a¥X¡@"³]©w¤Þ¥Î¶µ¥Ø"µøµ¡
©ó¨ä¤¤®Ö¨ú¡@"¢Ûicrosoft ActiveX Data Objects x.x Library"¿ï¶µ¡@¡]¿ï¾Ü³Ì·sª©¥»ªºADO)
¦p¦¹§Y¥i©óVBA¤¤¨ú¥ÎADOªº¨ç¦¡®w
   
2)    ¦pªG§A¨S¦³±N ¢ÏDO Library¡@´O¤J
¦b«Å§i®É§A´N¤£¯à«Å§iª«¥óÅܼƬ°ADODB .Connection  ( ex. Dim DB As ADODB.Connection)
¦Ó¥u¯à«Å§i¬°¤@¯ëª«¥óÅܼƠ (Dim DB As ¢Ýbject)
«Ø¥ß®É§A¤£¯à¨Ï¥Î¡@¡@Set DB = New   ADODB.Connection¡@³o¼Ëªº»yªk
¦Ó­n¥Î¡@¡@¡@DB = CreateObject("Adodb.Connection")
Alex

TOP

        ÀR«ä¦Û¦b : ¤Hªº²´·úªø¦b«e­±¡A¥u¬Ý¨ì§O¤Hªº¯ÊÂI¡Aµ·²@¬Ý¤£¨ì¦Û¤vªº¯ÊÂI¡C
ªð¦^¦Cªí ¤W¤@¥DÃD