[dba-SQLServer]ADO FInd and SQL Server

Francisco H Tapia my.lists at verizon.net
Mon Aug 25 12:03:35 CDT 2003


If this is SQL Server I'd modify this to be a stored procedure then just
use the command object

Set CMD = New ADODB.Command
    With CMD
        .ActiveConnection = Cnn
        .CommandType = adCmdStoredProc
        .CommandText = "stp_MySproc"

        .Parameters.Append .CreateParameter("@ClusterID", adInteger,
adParamInput, , Me.txtBuildingNumber)
        SET  RS = .Execute
        .ActiveConnection = Nothing
    End With


Eric Barro wrote:

>Try this...
>
>strSQL = "SELECT * FROM tblBuilding WHERE fldClusterID = " & Val(Nz(txtClusterID) & " AND fldBuildingNumber = '" & Nz(txtBuildingNumber) & "'"
>
>rstBuilding.Open strSQL, cnn, adOpenKeyset, adLockPessimistic
>
>---
>
>-----Original Message-----
>From: dba-sqlserver-bounces at databaseadvisors.com
>[mailto:dba-sqlserver-bounces at databaseadvisors.com]On Behalf Of
>Mwp.Reid at Queens-Belfast.AC.UK
>Sent: Monday, August 25, 2003 9:30 AM
>To: dba-sqlserver at databaseadvisors.com
>Subject: [dba-SQLServer]ADO FInd and SQL Server
>
>
>We need to pass multipe values to FInd or Filter in ADO.
>
>Any ideas?
>
>  rstBuilding.Open ("select * from tblBuilding"), cnn, adOpenKeyset, 
>adLockPessimistic
>
>        rstBuilding.Filter "fldClusterID = " & Val(Nz(txtClusterID)) & " AND 
>fldBuildingNumber = '" _
>            & Nz(txtBuildingNumber) & "'"
>
>
>  
>






More information about the dba-SQLServer mailing list