A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help updatecommand not updating



 
 
Thread Tools Display Modes
  #1  
Old February 25th, 2007, 03:27 PM posted to microsoft.public.access.queries
Fendi Baba
external usenet poster
 
Posts: 3
Default Help updatecommand not updating

I wrote to his of code to update a staus field ina table. Somehow
nothing happens though no error was thrown eitheie. Where did I go
wrong?

Please help. Thanks in advance.


Dim note As String
Dim ds As DataSet = New DataSet()
Dim query As StringBuilder = New StringBuilder()
Dim query1 As StringBuilder = New StringBuilder()
query.Append("Update ApptInfo Set ApptCompleted='True'")
query.Append(" where ApptID='" + id + "'")
Dim myConnection As OleDbConnection = New
OleDbConnection(Me.GetConnectionString())
Dim ad As OleDbDataAdapter = New OleDbDataAdapter()
ad.UpdateCommand = New OleDbCommand(query.ToString(),
myConnection)
Return ds

  #2  
Old February 25th, 2007, 11:12 PM posted to microsoft.public.access.queries
Gary Walter
external usenet poster
 
Posts: 613
Default Help updatecommand not updating

I am not familiar with your code, but maybe...

If ApptID is type "Number," then you don't need
to wrap "id" in single quotes...

query.Append(" where ApptID=" + id )

"Fendi Baba" wrote:
I wrote to his of code to update a staus field ina table. Somehow
nothing happens though no error was thrown eitheie. Where did I go
wrong?

Please help. Thanks in advance.


Dim note As String
Dim ds As DataSet = New DataSet()
Dim query As StringBuilder = New StringBuilder()
Dim query1 As StringBuilder = New StringBuilder()
query.Append("Update ApptInfo Set ApptCompleted='True'")
query.Append(" where ApptID='" + id + "'")
Dim myConnection As OleDbConnection = New
OleDbConnection(Me.GetConnectionString())
Dim ad As OleDbDataAdapter = New OleDbDataAdapter()
ad.UpdateCommand = New OleDbCommand(query.ToString(),
myConnection)
Return ds



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.