Dim cnn As new ADODB.Connection dim rst as new adodb.recordset dim strDB as string strDB=App.path+"\database\system.mdb;Jet OLEDB:database password=你的數据庫密碼;" cnn.connectionstring="provider=Microsoft.Jet.OLEDB.4.0;data source=" & strDB '連接字串 cnn.open rst.open "select * from table where name like '" & text1.text & "',cnn,adOpenStatic, adLockPessimistic
dim rst as new adodb.recordset
dim strDB as string
strDB=App.path+"\database\system.mdb;Jet OLEDB:database password=你的數据庫密碼;"
cnn.connectionstring="provider=Microsoft.Jet.OLEDB.4.0;data source=" & strDB '連接字串
cnn.open
rst.open "select * from table where name like '" & text1.text & "',cnn,adOpenStatic, adLockPessimistic
如果text1中未輸入參數值,那查詢的就是所有記錄