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

[µo°Ý] ½Ð°ÝVB6¦p¦ó³sµ²·sª©ªºACCESS©O?

[µo°Ý] ½Ð°ÝVB6¦p¦ó³sµ²·sª©ªºACCESS©O?

½Ð°Ý¦U¦ì¤j¤jVB6«ç»ò³sµ²·sª©ªºACCESS§r~
§Ú¦bEXCEL VBA©³¤U§@·~³s½uOK~
¦ý¬O·h¨ìVB6´N¤£¦æ¤F~
¤]¸Õ¹L§ó·s¦¨VB6 SP6~ÁÙ¬O¤£¦æ~

Á`¬O·|¥X²{¡u°õ¦æ¶¥¬q¿ù»~'-2147467259 (80004005)¡v

¤Wºôª¦¤å¤F¦n¤[³£¥u¦³°w¹ï°ÆÀɦW¬Omdbªº¡A

¨S¦³°w¹ï¡uaccdb¡vªº~

½Ð°Ý¦U¦ì¤j¤j¦³¸Ñ¨M¿ìªk¶Ü?

T1.jpg
  1. Private Sub Command1_Click()
  2.     RF = Text1.Text
  3.     bb = Label1
  4.     Call PPTR
  5.    
  6.     Label1 = AD
  7. End Sub


  8. Sub PPTR()

  9. '1.³s½u¥N¸¹
  10.     Dim myCon As ADODB.Connection '¶}¸ê®Æ®w
  11.     Dim mywq As ADODB.Recordset '¶}¸ê®Æªí

  12. '2.«Ø¥ßConnectionª«¥ó
  13.     Set myCon = New ADODB.Connection
  14. '3.³sµ²¸ê®Æ®w
  15.     'ÅX°Êµ{¦¡Provider = Microsoft.ACE.OLEDB.12.0
  16.     'Àɮצì¸mData Source=
  17.     myCon.Open "Provider = Microsoft.ACE.OLEDB.12.0;" & _
  18.     "Data Source =C:\Users\algo\Desktop\PDR.accdb;" & _
  19.     "Jet OLEDB:Database Password=a123;"

  20.     myCon.CursorLocation = adUseClient

  21. '4.«Ø¥ßRecordsetª«¥ó&³sµ²¸ê®Æªí
  22.     '¿ï¨úSELECT+Äæ¦ì+FROM+¸ê®Æªí¦WºÙ+Where+Äæ¦ì¦WºÙ
  23.    
  24.     RF = " SELECT top 1 " & " ½s¸¹, " & " ©m¦W, " & " ¾°È, " & " ½s½X " & _
  25.          " FROM PDA " & _
  26.          " WHERE ½s½X " & _
  27.          " LIKE  '" & P & "' "
  28.    
  29.     Set mywq = myCon.Execute(RF)
  30.    
  31.         AD = mywq.Fields("©m¦W")
  32.    
  33. '5.Ãö³¬³s½u
  34.     myCon.Close
  35.    
  36. '6.¥á±óª«¥ó
  37.     Set mywq = Nothing
  38.     Set myCon = Nothing
  39. End Sub
½Æ»s¥N½X
ACCESS³s½u.rar (584.84 KB)

¦^´_ 1# algoji3ji3

¥Î³o­ÓÀÉ¥h´ú¬Ý¬Ý
   
PDR.rar (369.38 KB)

TOP

¦^´_ 1# algoji3ji3


   ¦h¦¸´ú¸Õ¡A³£«ü¦V PDR.accdb ¬O­Ó·lÃaªºÀÉ¡AÁöµM¥i¥H¤â°Ê¥´¶}¡A¦ý¥ÎVB¥Î´N¬OµLªk¥´¶}¡A«Øij§A¦A°µ¤@­ÓÀÉ¥h´ú¸Õ

TOP

²©ö½d¨Ò¡A¦P¼Ë¥Î®v¥X¦PªùªºASP
­è¸Õ¹L
  1. Set conobject = Server.CreateObject("ADODB.Connection")
  2.          DBPath = Server.MapPath("mlebp-new.accdb")
  3.          conobject.Open "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" & DBPath
  4.         Set recobject=Server.CreateObject("ADODB.Recordset")
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¦^´_ 2# ¤p»x

ª©¤j±z¦n~
§Ú¸Õ¹L³s½u¡umdb¡v¡A¥i¥H³s½uµL»~~
¥Ø«e¬O­n³s½u¡uaccdb¡vÀÉ·|¦³¥X°ÝÃD~

¦w¸Ëªº¬O
vb6.0 sp6
Microsoft Access 2010
2007 Office system ÅX°Êµ{¦¡¡G¸ê®Æ³s½u¤¸¥ó
accessruntimeanddataconnectivity2007sp3-kb2526310-fullfile-zh-tw
AccessDatabaseEngine_X64

ª¦¤å¯à¸Ëªº³£¸Ë¤F....ÁÙ¬O¤£¦æ>"<¯S¨Ó¨D±Ï>"<

TOP

¤@¬qASPªºµ{¦¡½X¡A®v¥X¦Pªù½Ð°Ñ¦Ò
­«ÂI¬O§A¶}µoµ{¦¡ªº³o¥x¹q¸£¬O§_¦³¦w¸Ë2007¥H¤Wª©¥»ªºACCESS?
  1. <%@Language=VBScript %>
  2. <%
  3. Dim adoCon
  4. Dim rsLogbook
  5. Dim strSQL
  6. Set adoCon = Server.CreateObject("ADODB.Connection")
  7. adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("DatabaseName.mdb")
  8. Set rsLogbook = Server.CreateObject("ADODB.Recordset")
  9. strSQL = "SELECT TableName.FieldName FROM TableName;"
  10. rsLogbook.Open strSQL, adoCon
  11. Response.Write ("<br>")
  12. Response.Write (rsLogbook("FieldName"))
  13. rsLogbook.Close
  14. Set rsLogbook = Nothing
  15. Set adoCon = Nothing
  16. %>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¯¸¦b¥b¸ô¡A¤ñ¨«¨ì¥Ø¼Ð§ó¨¯­W¡C
ªð¦^¦Cªí ¤W¤@¥DÃD