14-06-15, 12:13 AM
25-09-15, 06:09 AM
انت سألت والاجابة لغيرك
PHP كود :
Option Compare Database
Option Explicit
Function SeekRecord()
Dim conn As ADODB.Connection
Dim rst As ADODB.Recordset
Set conn = New ADODB.Connection
Set rst = New ADODB.Recordset
'Set the connection properties and open the connection.
With conn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.ConnectionString = "<Drive>\<Path to Northwind sample database>"
.Open
End With
With rst
'Select the index used in the recordset.
.Index = "PrimaryKey"
'Set the location of the cursor service.
.CursorLocation = adUseServer
'Open the recordset.
.Open "Order Details", conn, adOpenKeyset, _
adLockOptimistic, adCmdTableDirect
'Find the customer order where OrderID = 10255 and ProductID = 16.
.Seek Array(10255, 16), adSeekFirstEQ
'If a match is found, print the quantity of the customer order.
If Not rst.EOF Then
Debug.Print rst.Fields("Quantity").Value
End If
End With
End Functio