-1

I got many things try but it always an error somebody know this problem? i want to delete all data using only one command button. :(

Edited by bantex07: n/a

Votes + Comments
Not real big on details, are you?
5
Contributors
4
Replies
8
Views
6 Years
Discussion Span
Last Post by mb01a
0

Not enough detail to go on. What have you tried? What does your database look like in terms of table structure? Do you mean delete all the data in one table? Do you mean all the data in all the tables? Do you mean drop the tables completely?

0

Even i am trying for the same think i want to delete all the data which is stored in the sql table . I dont want to drop the table but only want to delete all the data from one table using a command button.......plz help :(:(

0

If using ADO then try this

conn.begintrans 'conn-----adodb connection object
conn.execute "delete from table_name"
conn.committtrans

Edited by debasisdas: n/a

0

here's one I use sometimes. It gets the names of all user tables in the database and puts them in a comma delimited string. You can modify it to do whatever you want.


Function GetTableNames() As String

Dim tdf As TableDef
Dim dbf As Database
Dim sql As String

Set dbf = CurrentDb()
sql = ""

For Each tdf In dbf.TableDefs
If Left(tdf.Name, 4) <> "msys" Then
sql = sql & tdf.Name & ","
End If
Next
GetTableNames = Left(sql, Len(sql) - 1)
dbf.Close
Set tdf = Nothing

End Function

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.