PDA

Click to See Complete Forum and Search --> : Another query


gerard
Sep 10th, 2000, 09:43 AM
One other funny problem I have is that I have a SQL statemnt that deletes the contents of the table. If I step through the code in debug it deletes all the records, but if I run it from my app it does seem to delete. My cod eis as follows:

Dim rstcontrol As ADODB.Recordset

Set rstcontrol = cndata.Execute("Delete * from TempDatesTbl") 'cndata holds my connection string stuff

regards


Gerard

Clunietp
Sep 10th, 2000, 05:27 PM
change your SQL statement to this:

Delete from TempDatesTbl

you also don't need to assign this to a recordset object, since an action query will not return any records...

gerard
Sep 10th, 2000, 05:37 PM
Can you please show me some code how you would write the statment..without a recordset.

Sep 11th, 2000, 02:38 PM
Dim cn As New ADODB.Connection

cn.Open "....."
cn.Execute "Delete From tblX"
cn.Close

set cn = Nothing