Databaseguy
MIS
What's the better way ?
#1
Private Sub TestIt()
Dim rst as new adodb.recordset
strSQLStyleBody = "SELECT StyleID, [Body] from tblOrderDet WHERE JJNO = '" & Me.cboJob & Me.txtExt & Me.txtRev & "' GROUP BY StyleID, [Body]"
rstStyleBody.Open strSQLStyleBody, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
End Sub
#2
Private Sub TestIt()
Dim rst as new adodb.recordset
rstStyleBody.Open sp_SQLStyleBody, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
End Sub
Where the SQL in the stored procedure sp_SQLStyleBody is exactly the same as the first example with the addition of parameters.
Tyrone Lumley
augerinn@gte.net
#1
Private Sub TestIt()
Dim rst as new adodb.recordset
strSQLStyleBody = "SELECT StyleID, [Body] from tblOrderDet WHERE JJNO = '" & Me.cboJob & Me.txtExt & Me.txtRev & "' GROUP BY StyleID, [Body]"
rstStyleBody.Open strSQLStyleBody, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
End Sub
#2
Private Sub TestIt()
Dim rst as new adodb.recordset
rstStyleBody.Open sp_SQLStyleBody, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
End Sub
Where the SQL in the stored procedure sp_SQLStyleBody is exactly the same as the first example with the addition of parameters.
Tyrone Lumley
augerinn@gte.net