Results 1 to 3 of 3

Thread: TRUNCATE table

  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Why when i uset the statement TRUNCATE in sql have error, and not in delete *???

    Piece of code:

    Code:
    	Set RS1 = New ADODB.Recordset
    	Set RS2 = New ADODB.Recordset
    	Set CN1 = New ADODB.Connection
    
    	If RS1.State = adStateOpen Then RS1.Close
    	If RS2.State = adStateOpen Then RS2.Close
    	CN1.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & gPROVADatabasePath2
    	SQL = "DELETE * FROM FIDI"
    	CN1.Execute(SQL
    	
    	SQL = "TRUNCATE TABLE FIDI"
    	CN1.Execute SQL

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    TRUNCATE TABLE is valid in SQL Server but not in Microsoft Access.

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='796715' date='07-Oct-2009 11:02']TRUNCATE TABLE is valid in SQL Server but not in Microsoft Access.[/quote]

    AHHHHHHHHH.......
    Sorry.

Posting Permissions

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