Lm th? no ? s? d?ng ADO v?i Visual Basic

D?ch tiu ? D?ch tiu ?
ID c?a bi: 172403 - Xem s?n ph?m m bi ny p d?ng vo.
?i v?i m?t Microsoft Visual Basic.NET Phin b?n c?a bi vi?t ny, xem 308656.
Bung t?t c? | Thu g?n t?t c?

? Trang ny

TM T?T

Adovb.exe l m?t t?p tin nn self-extracting ch?a m?u m? m ch?ng t? lm th? no ? s? d?ng ActiveX Data Objects (ADO) trong Visual Basic.

THNG TIN THM

Cc t?p tin sau y c s?n ? t?i v? t? Microsoft Download Center:
http://Download.Microsoft.com/Download/vb60pro/demo/1/WIN98/en-US/AdoVB.exe
? c thm thng tin v? lm th? no ? t?i cc t?p tin h? tr? c?a Microsoft, b?m s? bi vi?t sau ? xem bi vi?t trong c s? ki?n th?c Microsoft:
119591 Lm th? no ? c ?c Microsoft h? tr? t?p tin t? cc d?ch v? tr?c tuy?n
Microsoft a quet vi-rut cho tp nay. Microsoft a s dung phn mm do tim vi-rut mi nht hin co vao ngay tp c ng. Cc t?p tin ?c lu tr? trn tng c?ng b?o m?t my ch? c th? gip ph?ng ng?a b?t k? thay ?i khng ?c php ? cc t?p tin.
Thu g?n b?ng nyBung r?ng b?ng ny
Tn t?pKich thcNgay
AdoDemo.mdb332 KB7/28/97
AdoVB18 KB8/5/97
AdoVB.vbp1 KB8/5/97
AdoVbEx6 KB7/28/97

Nh?ng g? Adovb ch?ng t?

Adovb ch?ng t? s? d?ng ph h?p c?a s?n l?ng v tr? l?i tham s? (?i v?i SQL Server), v m? m?t recordset parameterized cho c? m?t Microsoft Access v SQL Server ngu?n d? li?u. C?ng bao g?m l m?t khun m?u chung cho l?i x? l? v?i ADO M?:
   Private Sub cmdTemplate_Click()
      Dim Conn1 As adodb.Connection

      On Error GoTo VbError   ' Trap (non-ADO) error/exceptions

      ' Create Connection Object (using early binding)
      Set Conn1 = new ADODB.Connection

      On Error GoTo AdoError  ' Trap any error/exception

      Conn1.ConnectionString = AccessConnect
      Conn1.Open

      '----------------------
      ' YOUR CODE GOES HERE!
      '----------------------

      ' Successful Shutdown
      Conn1.Close

   Done:
      ' Miscellaneous (graceful) Cleanup
      On Error Resume Next

      Set Conn1 = Nothing

      Exit Sub

   ' ADO Error/Exception Handler
   AdoError:
      ' Save Error Information!
      ErrNumber = Err.Number
      ErrSource = Err.Source
      ErrDescription = Err.Description

      AdoErrorEx List1, Conn1

   ' Non-ADO Native error/exception handler
   VbError:
      VbErrorEx List1, ErrNumber, ErrSource, ErrDescription
      GoTo Done

   End Sub
				
GHI CH:
  • Khi s? d?ng ADOVB v?i ADO 2.0 ho?c sau ny, b?n nn lo?i b? tham chi?u ?n Microsoft OLE DB ActiveX Data Objects 1.0, v thi?t l?p m?t tham chi?u ?n phin b?n m?i nh?t c?a Microsoft ActiveX Data Objects c s?n.
  • Khi s? d?ng ADO 2.0 ho?c sau ny, tham kh?o cc ti s?n OriginalValue c?a m?t ?i t?ng ADO tr?ng s? cung c?p cho l?i sau, n?u LockType ADO Recordset ?c ch? l:
    Th?i gian ch?y l?i '3251': Thao tc yu c?u c?a cc ?ng d?ng khng ?c h? tr? b?i nh cung c?p.
    ? trnh l?i ny trong ADOVB, b?nh lu?n ra ho?c lo?i b? cc d?ng sau m?, trong s? ki?n nh?p chu?t th? t?c cho cmdAccess trong c?a s? m? cho frmADOVB:
    List1.AddItem vbTab & "OriginalValue= " & rs1.Fields(i).OriginalValue
    					

THAM KH?O

V? cc ADO * lo?t m?u

y l m?t trong m?t s? m?u gi?ng h?t nhau th?c hi?n b?ng cch s? d?ng ADO trong s?n ph?m khc nhau, nh ?c li?t k d?i y. L?i th? l nh?ng bi vi?t ny c m?t giao di?n/functionality gi?ng h?t nhau, ch?ng minh c? hai s? i?m tng ?ng v khc bi?t trong vi?c s? d?ng ADO v?i ngn ng? khc nhau / c ch?:
172403 T?p tin: Adovb.exe ch?ng t? lm th? no ? s? d?ng ADO v?i Visual Basic
220152 M?u: ADOVC1 n gi?n ADO / VC ++ ?ng d?ng
185033 T?p tin: Adoacc.exe th? hi?n b?ng cch s? d?ng ADO v?i truy c?p 97

Thu?c tnh

ID c?a bi: 172403 - L?n xem xt sau cng: 19 Thang Tam 2011 - Xem xt l?i: 2.0
p d?ng
  • Microsoft ActiveX Data Objects 2.7
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
T? kha:
kbdownload kbcode kbdatabase kbfile kbinfo kbsample kbstoredproc kbmt KB172403 KbMtvi
My d?ch
QUAN TRONG: Bi vi?t ny ?c d?ch b?ng ph?n m?m d?ch my c?a Microsoft ch? khng ph?i do con ng?i d?ch. Microsoft cung c?p cc bi vi?t do con ng?i d?ch v c? cc bi vi?t do my d?ch ? b?n c th? truy c?p vo t?t c? cc bi vi?t trong C s? Ki?n th?c c?a chng ti b?ng ngn ng? c?a b?n. Tuy nhin, bi vi?t do my d?ch khng ph?i lc no c?ng hon h?o. Lo?i bi vi?t ny c th? ch?a cc sai st v? t? v?ng, c php ho?c ng? php, gi?ng nh m?t ng?i n?c ngoi c th? m?c sai st khi ni ngn ng? c?a b?n. Microsoft khng ch?u trch nhi?m v? b?t k? s? thi?u chnh xc, sai st ho?c thi?t h?i no do vi?c d?ch sai n?i dung ho?c do ho?t ?ng s? d?ng c?a khch hng gy ra. Microsoft c?ng th?ng xuyn c?p nh?t ph?n m?m d?ch my ny.
Nh?p chu?t vo y ? xem b?n ti?ng Anh c?a bi vi?t ny:172403

Cung cp Phan hi

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com