|
-
Aug 15th, 2000, 04:07 PM
#1
Thread Starter
Lively Member
view this codes and tell me what i did wrong. this update statement don't do anything
Code:
datGrouping.RecordSource = "UPDATE [Contacts] SET [Group] = '" & tempstring & "'"
datGrouping.RecordSource = "SELECT * FROM [Contacts] ORDER BY CompanyName"
datGrouping.Refresh
-
Aug 15th, 2000, 04:22 PM
#2
Monday Morning Lunatic
Try using the Database.Execute method for 'action' queries.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 15th, 2000, 04:42 PM
#3
Frenzied Member
Originally posted by xstopx81
view this codes and tell me what i did wrong. this update statement don't do anything
Code:
datGrouping.RecordSource = "UPDATE [Contacts] SET [Group] = '" & tempstring & "'"
datGrouping.RecordSource = "SELECT * FROM [Contacts] ORDER BY CompanyName"
datGrouping.Refresh
Easy. The second setting of datGrouping.RecordSource overwrites the first.
-
Aug 17th, 2000, 04:51 PM
#4
Thread Starter
Lively Member
thanks for replying guys but your suggestions are not working. I have used execute command and also tried deleting the select statment. Both method does not seem to work
-
Aug 18th, 2000, 01:15 PM
#5
Hyperactive Member
Maybe you forgot the WHERE statament in the first line. The statment as it appears will not know what rows to update. If you include a "WHERE [PrimaryKey]='SomeValue'", it could work.
Good Look!
[Edited by Tonatiuh on 08-18-2000 at 02:18 PM]
Ulises Vázquez
[size=1.7]Oracle DBA Certified Professioanl
Visual Basic 6 Developer
Crystal Reports Designer
[/size]
-
Aug 18th, 2000, 01:25 PM
#6
Monday Morning Lunatic
If you leave out the WHERE clause, it updates all of them. Using the Execute method with an Update query worked for me.
Try:
Code:
DB.Execute "UPDATE Contacts SET Group = '" & tempstring & "'"
datGrouping.RecordSource = "SELECT * FROM Contacts ORDER BY CompanyName"
datGrouping.Refresh
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 18th, 2000, 01:46 PM
#7
Thread Starter
Lively Member
hey thanks for replying... parksie, in ur coding... what's DB? cant i just make it as datgrouping.database.execute? help
-
Aug 18th, 2000, 01:50 PM
#8
Monday Morning Lunatic
I just used DB as a placeholder for the original Database object.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Aug 18th, 2000, 03:31 PM
#9
Thread Starter
Lively Member
thanks parksie ... your coding works!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|