Update not updating

I'm using Web Matrix and the Update code wizard. I have an Access db with a table 'Users'.

This contains a Username (primary key) and a password.
If I use:-
"UPDATE [Users] SET [Password]=@Password WHERE ([Users].[User] = @user)"
the update does not work and no errors are reported.
If I use:-
"UPDATE [Users] SET [Password]=@Password WHERE ([Users].[User] = ""barry"")"
the update works!!!.
I've spent hours trying to resolve this to no avail.
Could this be a bug in oledb and if so does anyone have a work around?
Best frustrated regards
Barry
0
bazzasmith
11/24/2003 7:27:13 PM
asp.net.access-datasource 4679 articles. 0 followers. Follow

7 Replies
899 Views

Similar Articles

[PageSpeed] 24

How are you populating the value for @user?
David Wier
MCP/ASPInsider
ASPNet101.com - where to look first!
Control Grouper - easily control properties for multiple controls with one control!
Calendar Express - The Best HTML Calendar Generator on the web!
(Please 'Mark as Answer' when it applies)
0
augustwind
11/24/2003 7:41:09 PM
Hi Augustwind

With the arg set to @User
I use:-
RowsAffected = MyUpdate(MyTextbBox.text,NewPassword.text)
This is really frustrating - I've wasted hours trying to solve his now
Any idea's
Best regards
Barry
0
bazzasmith
11/25/2003 6:29:11 PM
Plus 

I have tried
RowsAffectec = MyUpdate("barry","PWD")
0
bazzasmith
11/25/2003 6:30:29 PM
Sorry

It may help if I include the code that Web Matrix generates:-
Function UpdateTest(ByVal user As String, ByVal password As String) As Integer
' label2.text=user
' label3.text=password

Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Mydatabase.mdb"
Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString)
Dim queryString As String = "UPDATE [Users] SET [Password]=@Password WHERE ([Users].[User] = @user)"
Dim dbCommand As System.Data.IDbCommand = New System.Data.OleDb.OleDbCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dbParam_user As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_user.ParameterName = "@User"
dbParam_user.Value = user
dbParam_user.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_user)
Dim dbParam_password As System.Data.IDataParameter = New System.Data.OleDb.OleDbParameter
dbParam_password.ParameterName = "@Password"
dbParam_password.Value = password
dbParam_password.DbType = System.Data.DbType.String
dbCommand.Parameters.Add(dbParam_password)
Dim rowsAffected As Integer = 0
dbConnection.Open
Try
rowsAffected = dbCommand.ExecuteNonQuery
Finally
dbConnection.Close
End Try
Return rowsAffected
End Function
End Sub

Sub Button1_Click(sender As Object, e As EventArgs)
dim p1 as string = "barry1"
dim p2 as string = "PWD"

dim r = updateTest(p1,p2)
label1.text = r
End Sub
0
bazzasmith
11/25/2003 6:49:39 PM
in OleDb, parameters are positional.  You must add them to the collection left to right, meaning @Password must be added first.

In addition, I do not believe that @Password or @User is required (or perhaps even allowed...). Generally in OleDb, you just use ? for parameter placeholders.
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
11/26/2003 1:54:18 AM
Your a Star

It works!!!!!!!
I just changes the position of the adds
Web Matrix Update Code Wizard has a bug then - I'll report it to them
I'm very grateful to you - now I can get on with the rest of the project.
Best regards
Barry
0
bazzasmith
11/26/2003 6:41:34 PM
Glad that did it for you!
Starting with ASP.NET 2.0? Look at:
Programming Microsoft Web Forms
My Blog
0
douglas
11/26/2003 6:56:05 PM
Reply:

Similar Artilces:

Updates Updates Updates
I was a big fan of Firefox.. Now, I don't even like to use it. Seems like every time I start it up I have to update some addin OR the browser itself. And unfortunately the update nag messages are always presented when I start a browsing session. I find this annoying because, typically, when I open a web browser all I want to do is go to a web page. Not update the browser. I can agree that staying current with the latest version could give the best, fastest, safest web experience. But that point becomes mute when I start off every other browsing session with a new update. And mos...

updates, updates, updates, NO MORE!
Name: Andreas Email: unbekanntatjokerdotms Product: Firefox Summary: updates, updates, updates, NO MORE! Comments: Hi ! if you want to develop a fine webbrowser, maybe you nee a new management. To release a new buggy version every two weeks is not very professional. Test your software before the release and let the user download a stable browser. this update-orgy since 2.0.0 used me to use Opera instead of FF. We haved use FF in our Company, but we can't deploy a new version every week to +200 Windows-clients, so in our company we've decided to return to IE, ...

updates, updates, updates
Holy Crap, Batman! You'd think I was running Windows XP and it's patch Tuesday. So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready to try one od the BSD's! vince wrote: > Holy Crap, Batman! You'd think I was running Windows XP and it's patch > Tuesday. > > So far this week - new kernel (2.6.27.10), 2 new browsers (Opera 9.63 > and Firefox 3.05) and a new plugin (Flash 10.0.156.3). I'm about ready > to try one od the BSD's! I take ...

Updates, updates and more updates
Name: pirhan Email: pirhan_chanathotmaildotcom Product: Firefox Summary: Updates, updates and more updates Comments: Hello, Normally I use Safari, but my iBook is out of commission for a while. So, I am forced to use a PC to which I would much rather use Firefox than Internet Exploder. However, as much I enjoy not using a Microsoft product, and use a product that works decently, I am severely annoyed about the constant updates I am put through. In the last two days, I had to wait for Firefox to install updates before I could browse and now, I'm alerted that there'...

updates, updates, updates
Name: hans jensen Email: hansjensen44_athotmaildotcom Product: Firefox Summary: updates, updates, updates Comments: why is it everytime i go online firefox has new updates, 3 -4 times every day, its never ending..........whats all the problems??? please email me and let me know, ty,.........Hans Jensen Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2 ...

Updates Updates Updates #3
Name: Product: Firefox Summary: Updates Updates Updates Comments: Seems like every time I open the program there is a wait period while some new arcane update gets installed. I have enjoyed and advocated firefox for a good while, but the update thing is really starting to bug me. Doubtless I could simply change the settings to accept the updates or not notify me or something similar - but I CAN'T BE ASSED. I'd have to consider this for more than 30 seconds and as we've already seen I CAN'T BE ASSED. Please make this less annoying in return for which I promis...

Update Update
Name: John Oswell Email: serviceatwinntecdotcom Product: Firefox Summary: Update Update - endless updates Comments: I think it's great you update the product but I'm starting to think this product is more prone to attack and instability by the number of updates i get inflicted with. Quite honestly on the Windows platform you're going to need to convince me that the Firefox browser is "better" than IE8 - my default browser (ff right now) I'm probably going to revert - endless intrusive updates for Firefox is getting very tiring. At least MS (I'm ...

Updates updates updates #2
Name: Product: Firefox Summary: Updates updates updates Comments: I love Firefox, but it seems EVERY day there is some sort of updates to download before it will open. You need to figure out a way Firefox can open when asked to do so and update in the background and apply the updates on the next restart. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide on...

updates,updates, updates,etc.
Name: Product: Firefox Summary: updates,updates, updates,etc. Comments: I am so fed up with all these gd updates I COULD SCREAM! Why can't you get it right and stay with it for a while. Between you guys and MSFT you drive me nuts. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Update update
Gang... Everything for the forthcoming SSL Certificate Fingerprinting system is finished and ready for pre-release deployment. But today the site has been -- and still is -- unusually busy. And I need to bring the server down briefly to update the master resident "ne.dll" which is where all this code lives. And doing that, boots everyone off, cancels all underway downloads, aborts ShieldsUP! runs, etc. So I want to wait a few hours until things have calmed down, and slowed, down a bit. -- ________________________________________________________________ Steve...

Updates and more updates and more...
Name: M Product: Firefox Summary: Updates and more updates and more... Comments: what's the point of this one exactly? Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11 ( .NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Why does update not update ?
Name: T. Strickland Email: shortsportatsbcglobaldotnet Product: Firefox Summary: Why does update not update ? Comments: I check to see if there are any updates but it says none are available but once in a while a update will just appear and say to update to 2.0.0.4 . could this be some kind of scam trying to gain access to my computer? If this is a good update then why doesn't the update do it automatically when I click on it ? Please Inform Tilmon Strickland Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.12) Gecko/20070508 Firefox/1.5.0...

An Update Update ...
Folks, Just off the phone with Mark again. It seems that the points I was making during my afternoon of "debate" with Mark were echoed by the one other person involved in the early (very early) testing of Spambo. As a result one more *VERY* cool feature will soon be added to Spambo: You'll be able to pop-up a listview of all recent eMail which has passed through Spambo -- and sort it any way you like -- where every item will have a "Spam checkbox" showing Spambo's current classification for that piece of eMail. Thus ... all you'll need t...

Web resources about - Update not updating - asp.net.access-datasource

Wikipedia:Updating information - Wikipedia, the free encyclopedia
This page documents an English Wikipedia editing guideline . It is a generally accepted standard that editors should attempt to follow, though ...

Facebook Updating Software Development Kit For Apple IOS 6 To Reflect Integration
With Facebook integration officially coming to Apple’s iOS 6 mobile operating system for its iPhone and iPad tablet, what new features are in ...

Updating how Cost per Click is Measured on Facebook
To help advertisers better understand how their ads perform, we're updating the definition of cost per click on Facebook. Learn what the change ...

Updating Your App for iOS 9: What You Need to Know
Updating Your App for iOS 9: What You Need to Know

Facebook for iPhone 3.0 to Include Page Updating
... who want to more easily update their Facebook Pages on the go: Facebook for iPhone 3.0 , which should be released soon, will include Page updating, ...

Updating trends on mobile
Trends are a great way to find out what people are talking about on Twitter at a given moment and at a single glance. Starting today, we’re making ...

Delhi Metro Fare Calculator and Auto-Updating Map on the App Store on iTunes
Get Delhi Metro Fare Calculator and Auto-Updating Map on the App Store. See screenshots and ratings, and read customer reviews.

BlackBerry Bold 9000 Updating #2 - Flickr - Photo Sharing!
Explore berrytokyo's photos on Flickr. berrytokyo has uploaded 126 photos to Flickr.

Freeview launches auto-updating EPG
Shows running late won't phase new Freeview PVRs, but the new Australian EPG doesn't work with all Freeview gear.

Tips For Updating Your Appearance
Like Joe Hockey, all men can pull off a radical mid-life makover by following some simple guidelines.

resources last updated: 11/20/2015 1:25:44 PM