Guys,
I am trying to make a copy of a database from an ASP page and then delete all the records that exist in three tables. The copy goes fine and I then connect to the copy and attempt to delete all records from the three tables as follows:
' Connect to the database copy
set conn = Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
conn.Open strConnect
' Delete all the records from the Lead Details Table
sql = "DELETE FROM [Lead Details]"
conn.Execute sql, , adCmdText
' Delete all the records from the Lead Master Table
sql = "DELETE FROM [Lead Master]"
conn.Execute sql, , adCmdText
' Delete all the records from the Company Master Table
sql = "DELETE FROM [Company Master]"
conn.Execute sql, , adCmdText
However, for some reason it never deletes the records from the third table - regardless of what order I place the delete statements in. i.e. if [Lead Details] is last, it will delete the records from the other two tables but not the [Lead Details] table. In the code above, records in the [Company Master] table are not deleted!!
Any ideas??? Mise Le Meas,
Mighty![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I am trying to make a copy of a database from an ASP page and then delete all the records that exist in three tables. The copy goes fine and I then connect to the copy and attempt to delete all records from the three tables as follows:
' Connect to the database copy
set conn = Server.CreateObject("ADODB.Connection"
conn.Open strConnect
' Delete all the records from the Lead Details Table
sql = "DELETE FROM [Lead Details]"
conn.Execute sql, , adCmdText
' Delete all the records from the Lead Master Table
sql = "DELETE FROM [Lead Master]"
conn.Execute sql, , adCmdText
' Delete all the records from the Company Master Table
sql = "DELETE FROM [Company Master]"
conn.Execute sql, , adCmdText
However, for some reason it never deletes the records from the third table - regardless of what order I place the delete statements in. i.e. if [Lead Details] is last, it will delete the records from the other two tables but not the [Lead Details] table. In the code above, records in the [Company Master] table are not deleted!!
Any ideas??? Mise Le Meas,
Mighty