Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-08-23 : 07:35:02
|
| jeffliew writes "i try to delete all data in table SMS by using following code >> delete from SMS .........when i using this code in MS sql, data has been delete, but if i make one module in VB, then i put this query, data in table SMS cannot be delete...why ahh??this is the example coding i do in the module, have anything i need to change ??*************************************************************Public Function Test() Dim RST As New ADODB.Recordset, Rs As New ADODB.Recordset Dim conn As New ADODB.Connection Dim Total As Integer, Person As String Dim strSQL As String strSQL = "select distinct message from SMS_Database" Set RST = myDB(strSQL, adLockReadOnly) Do While Not RST.EOF Person = RST.Fields(0).Value strSQL = "delete from SMS" strSQL = "select count(*) from SMS_Database where message ='" & Person & "'" Set Rs = myDB(strSQL, adLockReadOnly) Total = Rs.Fields(0).Value strSQL = "Insert Into SMS (Actor,Vote) Select '" & Person & "','" & Total & "'" Set Rs = myDB(strSQL, adLockReadOnly) frmresult.List1.AddItem Person frmresult.List2.AddItem Total RST.MoveNext' frmresult.List1.AddItem Person' frmresult.List2.AddItem Total Loop" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-08-23 : 07:41:46
|
| You did not execute after strSQL = "delete from SMS"and what are you trying to do on the code?MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|