|
-
Sep 11th, 2001, 03:23 AM
#1
Thread Starter
Lively Member
Replace ! any solutions
Hi !
I was not able to find the proper answer to the replace command in VB using MSACCESS. Replacing all the records or range of records with a single syntax like "UPDATE ITEM SET QTY = 0 ". this command gives me the error.
Please help
thankx
Link is given below
http://www.vbforums.com/showthread.p...110#post524110[URL=Link to my post]
-
Sep 11th, 2001, 03:40 AM
#2
Addicted Member
Can you be more specific what kind of error it is?
In the Query design make sure you have selected the correct table and that you are passing the right data type to the field /e.g. no missmatch like passing 0 to a string/
-
Sep 11th, 2001, 03:40 AM
#3
-= B u g S l a y e r =-
Originally posted by Rahul2kind
But I required the syntax so that in a single command or sets of command all the qty is set to 0
This "Update item set qty = 0 " is working when I use directly in Visdata (Visual data manager in VB) sql statement, but through vb program it is given error when I refresh.
My syntax
f1.strRSname = "update item set qty= 0"
Data2.DatabaseName = f1.strDBname
Data2.RecordSource = f1.strRSname
Data2.Refresh
----------
think the problem is that u have to do an Execute on the SQL statement, not try to set it as the recordsource of a datacontrol.
try something like this:
VB Code:
Data2.Database.Execute "update item set qty= 0"
-
Sep 11th, 2001, 03:55 AM
#4
Addicted Member
Absolutely correct.
I didn't know you were seting recordset to that! This is an action query and you can not set a recordset object to it! It can only get executed!
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
|