1.VBå
³äºACCESSçç¨åºä»£ç
VBå ³äºACCESSçç¨åºä»£ç
å¨VBèåâè¿ç¨âå¼ç¨âå¯¹è±¡åº "Microsoft ActiveX Data Objects 2.5 Library"
'å®ä¹
Private Sub Command1_Click()
Const connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
dim conn As New ADODB.Connection
dim Rs As New ADODB.Recordset
dim sql As string
conn.Open connStr & "ãæçæ°æ®åºè·¯å¾åæ件.mdbã"
sql = "SELECT * FROM ä½ ç表åå称"
Rs.Open sql,源码畅购源码 conn, adOpenKeyset, adLockPessimistic
If Not Rs.State = adStateOpen Then 'ç¡®å®æ°æ®åºè½é¡ºå©æå¼åï¼æçç¥è¿ä¸ªå¤æ
MsgBox "æ°æ®åºæ²¡æå¼å¯ãæ£æ¥æ°æ®åºçé¾æ¥æ¯åªå¿åºé®é¢ï¼"
exit sub
End If
âæ°æ®åºè½å¼å¯æä¼ç»§ç»å¾ä¸ä¸è¡è¿è¡
Rs.MoveLast: Rs.MoveFirst
âè¿ä¸è¡åªæ¯æ£æ¥Rsæ¯ä¸æ¯æ£å¸¸è¿è¡ï¼æ´ä½ä»£ç å®æåå¯ä»¥ç§»é¤
MsgBox "è®°å½éæ»å ±ç¬æ°ï¼" & Rs.RecordCount
â æ°æ®åºç¡®å®è½æ£å¸¸å¼å¯äºï¼æ³ç»§ç»æä½æ°å¢ãæ´æ°ãå é¤...é½è¡
'å¼å§æ°å¢ä¸ç¬æ°æ®
'Rs.AddNew
'.......èµå¼ä»£ç
'.......èµå¼ä»£ç .
âRs.Update
'Rs.Refresh
End Sub