Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to clear all Records from Table

Status
Not open for further replies.

Maniac777

Technical User
Jul 20, 2005
9
GB
Hi!

I've problems with clearing the table's records. I've alredy tried some of the cummon way but instead of deleting it does nothing, neighter shows the debugger an error-msg.

I'm using the DAO module. I'ms sure there are better modules but I need this module...

The code I use:
------------------------------------------
Public Function clearRecords()

Set db = DBEngine.OpenDatabase(db_name)
db.Execute "DELETE * FROM paData"

End Function
------------------------------------------

The is no password set...
Could you show me another way to handle this problem?
Do you know a quite good manual for DAO beside msdn?

tia

PS: Sorry for my poor english ;)
 
Seems like at least one of the fields are of datatype text, then it will need delimiters (single quotes) - also look at the last part of the statement - ORDER BY - not SORT BY.

[tt]...Project='" & prno & "' AND EmployeeSupplier='" & emplsupp & "' ORDER BY...[/tt]

Roy-Vidar
 
Thanks guys, that was the thing! This problem is solved. Just another hundred hands full of probs are wating... ;)
 
It seems like there were a couple of problems solved here. For the sake of those who might find this thread in the future via a search, could you please recap what both of the problems were and how they were solved?

Thanks
 
The first one was solved because I' done what bjd4jc(Programmer) said on 20-Jul-05 12:15. Then I found a litte typing mistake... :(
--> Solved

The second problem was solved because I've change the incorrect 'SORT BY' into a 'ORDER BY' and I placed single quotes around the values in the WHERE-statement.

Thx again guys! Your are the fastest AND the most competent community I've subscribed! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top