Welcome to dbFreaks.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

update query

 
   Database Help (Home) -> Visual Basic RSS
Related Topics:
Can I Update entire record in SQL ? - Heya, I am working on making a SQL database an exact mirror of a local Access database. I check the .mdb database every few minutes for new entries, if there are new entries, I retrieve them and write them to an exact replica table in SQL. This all works

NEWBIE insert data rather than update in db - I have an app for tracking mileage on company vehicles. On the first form you select a combobox getting vehicle names from database) and enter the info. Then I need to export that data back to the database. The ? is how do I..

Package & Deployment wizard: Update a database - Dear, I have developed a VB6.0 which uses an access database. I deployed this with the & from Visual Basic, and it works fine. Due to some new I had to add an extra column to..

INSERT SQL query help with VB please? - Hello, I am trying to run an SQL query on a database through VB6 which is supposed to add data to a table called tblNames. There are 4 text fields on the form where data is added. here's the code. Dim i As Integer Set db1 = New

sql query returns in wrong format - Hi, Hope someone can help me with this. I have MS SQL 2000 database where i have Table and there a column wich is data type All data in this column is in form So why when i run .asp page with simple query to..
Next:  ACCESS FORM / REPORTS WIZARD NOT WORKING  
Author Message
Ian Davies

External


Since: Feb 06, 2005
Posts: 10



(Msg. 1) Posted: Sun Feb 13, 2005 3:40 pm
Post subject: update query
Archived from groups: comp>lang>basic>visual>database (more info?)

I have created an update query in my dataenvironment to change the date in
the bound table to the sys date. However, the query will not accept '=Date'
in the new value box. Does anyone know the correct function. The help gives
it as 'Date'
Ian

 >> Stay informed about: update query 
Back to top
Login to vote
Steve Gerrard1

External


Since: Aug 04, 2004
Posts: 9



(Msg. 2) Posted: Sun Feb 13, 2005 3:40 pm
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ian Davies" <ian.dandav.DeleteThis@virgin.net> wrote in message
news:rVNPd.1680$ma4.240@newsfe2-gui.ntli.net...
|I have created an update query in my dataenvironment to change the date
in
| the bound table to the sys date. However, the query will not accept
'=Date'
| in the new value box. Does anyone know the correct function. The help
gives
| it as 'Date'
| Ian
|
|

It sounds like you are trying to enter the value as a Parameter in the
DE, which is not going to work. You can create a query which accepts a
parameter, but you would then need to assign the value in code, just
before running the query. The DE new value box will accept only literal
values.

It will be much easier for you to simply create the update query in
Access. Once you have tested it and are sure it works, switch the query
to SQL view, and copy the SQL text.

Then, over in VB, in the data environment command, select the SQL
option, and paste in the SQL text. All done.

 >> Stay informed about: update query 
Back to top
Login to vote
John Blessing2

External


Since: May 11, 2004
Posts: 3



(Msg. 3) Posted: Sun Feb 13, 2005 4:40 pm
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ian Davies" <ian.dandav RemoveThis @virgin.net> wrote in message
news:rVNPd.1680$ma4.240@newsfe2-gui.ntli.net...
 >I have created an update query in my dataenvironment to change the date in
 > the bound table to the sys date. However, the query will not accept
 > '=Date'
 > in the new value box. Does anyone know the correct function. The help
 > gives
 > it as 'Date'
 > Ian
 >

Depends on which database you are using, but Now usually works

--
John Blessing

<a style='text-decoration: underline;' href="http://www.LbeHelpdesk.com" target="_blank">http://www.LbeHelpdesk.com</a> - Help Desk software priced to suit all
businesses
<a style='text-decoration: underline;' href="http://www.room-booking-software.com" target="_blank">http://www.room-booking-software.com</a> - Schedule rooms & equipment bookings
for your meeting/class over the web.
<a style='text-decoration: underline;' href="http://www.lbetoolbox.com" target="_blank">http://www.lbetoolbox.com</a> - Remove Duplicates from MS Outlook<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: update query 
Back to top
Login to vote
Ian Davies

External


Since: Feb 06, 2005
Posts: 10



(Msg. 4) Posted: Sun Feb 13, 2005 5:40 pm
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I am using Access 2000
Ive tried date, =date, dat(), =date(), now, =now
but nothing works

Ian


"John Blessing" <newsgroup.TakeThisOut@LbeHelpdesk.com> wrote in message
news:379r0nF56jd6jU1@individual.net...
 > "Ian Davies" <ian.dandav.TakeThisOut@virgin.net> wrote in message
 > news:rVNPd.1680$ma4.240@newsfe2-gui.ntli.net...
  > >I have created an update query in my dataenvironment to change the date
in
  > > the bound table to the sys date. However, the query will not accept
  > > '=Date'
  > > in the new value box. Does anyone know the correct function. The help
  > > gives
  > > it as 'Date'
  > > Ian
  > >
 >
 > Depends on which database you are using, but Now usually works
 >
 > --
 > John Blessing
 >
 > <a style='text-decoration: underline;' href="http://www.LbeHelpdesk.com" target="_blank">http://www.LbeHelpdesk.com</a> - Help Desk software priced to suit all
 > businesses
 > <a style='text-decoration: underline;' href="http://www.room-booking-software.com" target="_blank">http://www.room-booking-software.com</a> - Schedule rooms & equipment bookings
 > for your meeting/class over the web.
 > <a style='text-decoration: underline;' href="http://www.lbetoolbox.com" target="_blank">http://www.lbetoolbox.com</a> - Remove Duplicates from MS Outlook
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: update query 
Back to top
Login to vote
Ian Davies

External


Since: Feb 06, 2005
Posts: 10



(Msg. 5) Posted: Sun Feb 13, 2005 6:40 pm
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks

I just gave that a go with the following results


SQL Builder (as mentioned earlier)

UPDATE Timer
SET Days = 1, OpenDate = Date()
(As I mentioned I couldnt type in the 'date()' bit without the message "Your
entry cannot be converted to a valid date time value"


Using Access query

UPDATE Timer SET Timer.OpenDate = Date(), Timer.Days = 1;

even using cut and paste from Access it accepts it and allows me to save the
query but ON SAVING I get the message
'Incomplete SET clause
Unable to parse query text'


Ian


"Steve Gerrard" <mynamehere DeleteThis @comcast.net> wrote in message
news:042dnc5jg_-KVJLfRVn-sw@comcast.com...
 >
 > "Ian Davies" <ian.dandav DeleteThis @virgin.net> wrote in message
 > news:rVNPd.1680$ma4.240@newsfe2-gui.ntli.net...
 > |I have created an update query in my dataenvironment to change the date
 > in
 > | the bound table to the sys date. However, the query will not accept
 > '=Date'
 > | in the new value box. Does anyone know the correct function. The help
 > gives
 > | it as 'Date'
 > | Ian
 > |
 > |
 >
 > It sounds like you are trying to enter the value as a Parameter in the
 > DE, which is not going to work. You can create a query which accepts a
 > parameter, but you would then need to assign the value in code, just
 > before running the query. The DE new value box will accept only literal
 > values.
 >
 > It will be much easier for you to simply create the update query in
 > Access. Once you have tested it and are sure it works, switch the query
 > to SQL view, and copy the SQL text.
 >
 > Then, over in VB, in the data environment command, select the SQL
 > option, and paste in the SQL text. All done.
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: update query 
Back to top
Login to vote
Steve Gerrard1

External


Since: Aug 04, 2004
Posts: 9



(Msg. 6) Posted: Sun Feb 13, 2005 6:50 pm
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Ian Davies" <ian.dandav.TakeThisOut@virgin.net> wrote in message
news:VqQPd.1439$xg6.219@newsfe1-gui.ntli.net...
| Thanks
|
| I just gave that a go with the following results
|
|
| SQL Builder (as mentioned earlier)
|
|
| even using cut and paste from Access it accepts it and allows me to
save the
| query but ON SAVING I get the message
| 'Incomplete SET clause
| Unable to parse query text'
|
|

SQL Builder gave me the same message. However, you don't have to use SQL
Builder. When you choose the SQL Statement option for your command, you
can just paste the text in the box, and click OK.

I set up the following:
DE1 (connected to db1.mdb)
cmdTest
SQL Statement:
UPDATE Table1 SET Field2 = DATE()

Private Sub Command1_Click()
Call DE1.cmdTest
End Sub

Field2 was indeed updated to 2/13/2005
 >> Stay informed about: update query 
Back to top
Login to vote
Ian Davies

External


Since: Feb 06, 2005
Posts: 10



(Msg. 7) Posted: Mon Feb 14, 2005 6:40 am
Post subject: Re: update query [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks
Ill do it that way then

Ian
"Steve Gerrard" <mynamehere DeleteThis @comcast.net> wrote in message
news:m_mdnUea8ONono3fRVn-gw@comcast.com...
 >
 > "Ian Davies" <ian.dandav DeleteThis @virgin.net> wrote in message
 > news:VqQPd.1439$xg6.219@newsfe1-gui.ntli.net...
 > | Thanks
 > |
 > | I just gave that a go with the following results
 > |
 > |
 > | SQL Builder (as mentioned earlier)
 > |
 > |
 > | even using cut and paste from Access it accepts it and allows me to
 > save the
 > | query but ON SAVING I get the message
 > | 'Incomplete SET clause
 > | Unable to parse query text'
 > |
 > |
 >
 > SQL Builder gave me the same message. However, you don't have to use SQL
 > Builder. When you choose the SQL Statement option for your command, you
 > can just paste the text in the box, and click OK.
 >
 > I set up the following:
 > DE1 (connected to db1.mdb)
 > cmdTest
 > SQL Statement:
 > UPDATE Table1 SET Field2 = DATE()
 >
 > Private Sub Command1_Click()
 > Call DE1.cmdTest
 > End Sub
 >
 > Field2 was indeed updated to 2/13/2005
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: update query 
Back to top
Login to vote
Display posts from previous:   
   Database Help (Home) -> Visual Basic All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]