Results 1 to 4 of 4

Thread: Another query

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69

    Unhappy

    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
    Live long and prosper...

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    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...

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Australia
    Posts
    69
    Can you please show me some code how you would write the statment..without a recordset.
    Live long and prosper...

  4. #4
    Guest
    Dim cn As New ADODB.Connection

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

    set cn = Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width