L
-LeguMan-
Hello,
I'm looking for a way to execute a SQL request. This request must be hard
coded and lauched from a button in a form.
I was trying somthing like this but it doesn't work ...
Dim rst As New ADODB.Recordset, cnn As New ADODB.Connection
Set cnn = CurrentProject.Connection
StrSQL = "Select famille.ID FROM famille WHERE famille.ID = 'Toto'"
rst.Open StrSQL, cnn, adOpenForwardOnly, adLockReadOnly
msgbox (rst.RecordCount)
rst.Close
Set rst = Nothing
Set cnn = Nothing
Can someone Help ?
PS : the result of the query must be in a recordset.
Thanks,
LeguMan
I'm looking for a way to execute a SQL request. This request must be hard
coded and lauched from a button in a form.
I was trying somthing like this but it doesn't work ...
Dim rst As New ADODB.Recordset, cnn As New ADODB.Connection
Set cnn = CurrentProject.Connection
StrSQL = "Select famille.ID FROM famille WHERE famille.ID = 'Toto'"
rst.Open StrSQL, cnn, adOpenForwardOnly, adLockReadOnly
msgbox (rst.RecordCount)
rst.Close
Set rst = Nothing
Set cnn = Nothing
Can someone Help ?
PS : the result of the query must be in a recordset.
Thanks,
LeguMan