SQL Update question

Good morning,
I have 3 fields [printtab], [rotation], & [adn]. Rotation and adn are
True/False fields. The printtab is a number field.

In stead of having 3 SQL statements, I'd like to update the fields like this:

strSQL = "UPDATE tblconfig SET [rotation] = True, [printtab] = 1, [adn] =
True"
 
 '************* Updates the Config File *************
 CurrentDb.Execute strSQL, dbFailOnError

When I tried it it kept on giving me errors.
Error:3061. Too few parameters. Expected 1.

Can it be done like above or do I need to use 3 SQL statements?

Thank you for your input.

-- 
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-queries/201006/1

0
Afrosheen
6/2/2010 1:30:19 PM
access.queries 6343 articles. 1 followers. Follow

2 Replies
653 Views

Similar Articles

[PageSpeed] 23

No, it can be done in one query.  The error message indicates that one of the 
field names is incorrectly spelled or that True is being misunderstood for 
some reason.

Try
strSQL = "UPDATE tblconfig SET [rotation] = -1, [printtab] = 1, [adn] = -1"

If that still gives you the same error, double check the spelling of the field 
names.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Afrosheen via AccessMonster.com wrote:
> Good morning,
> I have 3 fields [printtab], [rotation], & [adn]. Rotation and adn are
> True/False fields. The printtab is a number field.
> 
> In stead of having 3 SQL statements, I'd like to update the fields like this:
> 
> strSQL = "UPDATE tblconfig SET [rotation] = True, [printtab] = 1, [adn] =
> True"
>  
>  '************* Updates the Config File *************
>  CurrentDb.Execute strSQL, dbFailOnError
> 
> When I tried it it kept on giving me errors.
> Error:3061. Too few parameters. Expected 1.
> 
> Can it be done like above or do I need to use 3 SQL statements?
> 
> Thank you for your input.
> 
0
John
6/2/2010 3:17:07 PM
Thanks for the quick come back. Your suggestion worked. I really appreciate
the help
There was a field error spelling problem. I should have used [printab]
instead of [printtab]
Thanks again for the direction.

John Spencer wrote:
>No, it can be done in one query.  The error message indicates that one of the 
>field names is incorrectly spelled or that True is being misunderstood for 
>some reason.
>
>Try
>strSQL = "UPDATE tblconfig SET [rotation] = -1, [printtab] = 1, [adn] = -1"
>
>If that still gives you the same error, double check the spelling of the field 
>names.
>
>John Spencer
>Access MVP 2002-2005, 2007-2010
>The Hilltop Institute
>University of Maryland Baltimore County
>
>> Good morning,
>> I have 3 fields [printtab], [rotation], & [adn]. Rotation and adn are
>[quoted text clipped - 14 lines]
>> 
>> Thank you for your input.

-- 
Message posted via http://www.accessmonster.com

0
Afrosheen
6/2/2010 4:14:55 PM
Reply:

Similar Artilces:

Free/Busy not updating
I have a user whose Free/Busy has not updated since 11/28 of this year. All times are synchronized and all typical free/busy settings are correct. Any ideas as to why free/busy is not updating? Thanks, Try opening Outlook using the ".../CleanFreeBusy" switch. The link(s) below will give you the instructions on how to use it. OL98: Additional Command-Line Switches http://support.microsoft.com/default.aspx?kbid=182112 OL2000: Additional Command-Line Switches http://support.microsoft.com/default.aspx?scid=KB;en-us;197180& OL2002: Additional Command-Line Switches http://sup...

Always Updating Stock prices M06
How does one stop M06 from always updating stock prices? It is extremely annoying to have bum prices updated on weekends and interday prices during the week. I have broker account, credit card, bank accounts as well as a watch list. In microsoft.public.money, arthur wrote: >How does one stop M06 from always updating stock prices? It is >extremely annoying to have bum prices updated on weekends and interday >prices during the week. I have broker account, credit card, bank >accounts as well as a watch list. Deselect Portfolio->UpdatePrices->UpdateAutomicallyEvery__Minute...

DSum Question
I have a continuous form with an unbound text box that has a DSum function as it's control source. It is used to display the sum of a field in a query. It works fine except that the last line of my form (the one for a new record) displays #Error in this text box. My DSum function is; = DSum("SumOfFootprint", "qryBoxTotals", "BinID = " & [BinID]) I've tried assigning it to the text box control source through code; Me.txtFootPrintSum.ControlSource = DSum("SumOfFootprint", "Query1", "BinID = " & Me![BinID]) but th...

Calling Dex Procedures from SQL
Is there any way to call dex procs from SQL or VB code? Jed There is an undocumented and unsupported method of calling Dex code from VBA. However, I know of no method of calling Dexterity from SQL. Please email me if you want an example, just remove the online. from the address below. David Musgrave [MSFT] Senior Development Consultant MBS Services - Asia Pacific Microsoft Business Solutions http://www.microsoft.com/BusinessSolutions mailto:dmusgrav@online.microsoft.com Any views contained within are my personal views and not necessarily Microsoft Business Solutions policy. This p...

is SQL 2000 architecture different SQL Server 2005 / 2008 architecture?
Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I have been told is a good book. I am going backwards... reading about the sql server architecture in chapter 3 of the book. As I'm reading... I was wondering is it different SQL Server 2000 vs SQL Server 2005/2008? Also where can I find a book/or link that can give me more details about the internals on architecture? Thank you norm (normanchan@gmail.com) writes: > Hi I have a book "inside SQL Server 2000" by Kalen Delaney, which I > have been told is a good book. I am g...

Update Values from a Userform
Dear all, I'm trying to update some information in ms access from a useform in ms excel. My problem is that I don't known how to do for the vba code understand the values in my form... This is the code: Sub update_tax() Dim wrkSpace As DAO.Workspace Dim db As DAO.Database Dim qryDef As DAO.QueryDef Dim qryNome As String Dim strSQL As String Dim strDB As String On Error Resume Next strDB =3D ThisWorkbook.Path & "\bd.mdb" Set wrkSpace =3D Workspaces(0) Set db =3D wrkSpace.OpenDatabase(strDB) qryNome =3D "qryUpdate_Tax" db.QueryDefs.Delete qryNome strSQL =3...

Moving customizations from SQL 2k to SQL 2k5 CRM
This may be a non-issue but I wanted to check to see if anyone has done this and ran into issues. I have the XML customization files from our previous install of CRM 3.0 with SQL 2k database. I now want to import and publish these same customizations to CRM 3.0 on SQL 2k5. Has anyone done this or can point me to documentation that tells about the success or issues for doing this? Thanks. On 7 Feb., 06:35, Chris Treanor <ChrisTrea...@discussions.microsoft.com> wrote: > This may be a non-issue but I wanted to check to see if anyone has done this > and ran into issues. > &...

Updating control values
I give in. I'm making my first VC++6 app (dialog) and I can't figure out this very basic thing, even after looking through all my resources and the Web. So far: -- in dialog editor, added some CEdit and STATIC controls. -- created member variables for those controls -- compiled file and dialog displays Now, how do I get/set the values of the CEdit boxes? In myAppDlg.cpp I type CmyAppDlg:: and all my methods and variables show...Great. But after I choose a variable and type a dot: CmyAppDlg::m_Edit_1. No methods appear (are they supposed to?). If I try to add one CmyApplDlg::m_Ed...

OWA 2003 questions
Hi Before i was using Exchange 2000, since I've made the upgrade to Exchange 2003 when I go to the OWA 2003 web site I have this message after my credentials has been entered. This page contains both secure and non-secure items. Do you want to display the non secure items. After that message the padlock at the bottom of the screen disapears. This is not seems good to me When I was on Exchange 2000 I didn't have this message Thanks Are you using OWA with our without SSL? If you are trying to use it with SSL you will need to have a certificate authority setup in your doma...

CRM 3.0 Install Error with SQL Reporting Services and SQL 2005
Hi, Doing a CRM 3.0 Server installation. During the last page of the install wizard (or what I assume is the last page) when I goes through and does verification I get a red X next to SQL Reporting Services. The message I receive when I look at the details is: ***** The specified path is not a metabase path. Parameter name: path ***** Now SRS is installed and working. I put in the URL: http://<servername>/reportserver and every other variation on that I can find. Thoughts? Alan try http://servername/reports also assuming you did not use ssl... =======================...

sql summarizing help
Hi All, Given: table1 --------- id, cdate, weeksago, amount, typeid, timeclose 496, 2010-02-11, 0, 450, 3, 1 490, 2010-02-01, 1, 200, 4, 1 491, 2010-02-01, 1, 350, 2, 2 493, 2010-02-01, 1, 500, 5, 1 489, 2010-01-21, 3, 150, 2, 1 136, 2010-01-12, 4, 500, 3, 2 137, 2010-01-12, 4, 100, 3, 1 138, 2010-01-12, 4, 500, 2, 1 1. i'm trying to create a sql that will give me a summary resultset grouped by weeksago. 2. i want to sum the columns and get counts based on typeid. 3. avg of timeclose here's the sql i have: select weeksago, , (sum(timeClose)/(count(timeclo...

thread question #4
How can I determine in a block of code if the thread it's running in is the same as the main GUI thread? I was trying to use GetCurrentThread to get the thread the function is being called from. Not sure how compare that to GUI thread. On Wed, 21 Dec 2005 13:58:35 -0600, "Eric Margheim" <NOSPAM***eric@prism-grp.com***NOSPAM> wrote: >How can I determine in a block of code if the thread it's running in is the >same as the main GUI thread? > >I was trying to use GetCurrentThread to get the thread the function is being >called from. Not sure how...

SQL 'for xml' and C# example??
I'm missing some piece of the puzzle. I'm using 'for xml' type queries from SQL2K - and now trying to change the front-end from ADO to C#, I can't quite figure it out.. It seems that I could use an XmlReader.. and somehow use that instead of a DataReader.. but that didn't work.. I tried using a DataReader and get the byte array - but that wasn't right. SQL returns formatted XML, I need to load that XML into an XmlDocument somehow without ANY molestation of that dom. Any ideas? Examples? Missing links???? thanks THANKS!! I've been looking for the answer to ...

Trying to update to Outlook 2003 distroyed my computer
And, there's no help from MS to get it back the way it was. I've tried restoring, removing outlook but now when ever I try to use a windows component, I get a windows setup or windows install dialog box and it's never able to find what ever it's looking for. I can't even go into add remove windows components. My mail files were totally messed up and finally had to uninstall all my office apps to even get the search files and folders to open without the windows install dialog box. Because of all the updates, I can't even use my Windows xp pro CD to try to repair the dam...

Update multivalue field in table from form with SQL
Access 2007 on Vista I am using a form to establish the variables for a report before it is created. One field on the underlying table is a multivalue field, and the form includes a multi-select combo box control. After selections are made and the OK button on the multi-select combo drop down is clicked, focus moves to the next control. I have discovered though, that the underlying table does not update immediately, but does so correctly when I close the form. This sequence does not deliver the proper report data, so I need a way to immediately update the underlying table (m...

Stupid question, I know
I feel like an idiot for even having to ask but I haven't been able to find a definitive answer anywhere. When building a new Exchange Server, do you need both an O/S (Windows Server 2003) and Exchange Server (Standard or Enterprise) Edition on the server or does the Exchange Server 2003 serve as the O/S? Let the comments begin.... You need Windows Server 2003 or 2000. Now if you purchase SBS 2003 then Exchange comes as part of the SBS Suite of applications but all applications must be run from the SBS Server. -- John Oliver, Jr MCSE, MCT, CCNA Exchange MVP 2006 Microsoft Certified ...

Automatically enter date and time but only update once.
I have a workbook that contains 14 sheets. I have a sheet for each month followed by 2 sheets for information. Each Month sheet has the following column headings associated from columns A through J:- Owner; from date; number of days; to date, address, ID, month, input by; date; time. I have to input data in columns A, B, C E, H, I and J. Columns A and H are pick lists. I have formulas in the following columns:- Column C: =IF(ISBLANK(Cnn),"",+Bnn+Cnn) Column F: =IF(ISBLANK(Enn),"",+Fnn+1) I want column I to be populated AUTOMATICALLY (do not want to use the Contr...

Windows Update Agent 7.4.7600.226
My Dell Inspiron 1520 laptop with Windows Vista Home Premium has failed to load the subject update on 20 different occasions since 13Nov09. The "Error Details" is Code 80073712, which is nothing more than a general error code with no specific fixes recommended. Anybody have an idea as to how to resolve this issue? "BigRedWingsFan" <me@privacy.net> wrote in message news:uA$ddLKbKHA.3768@TK2MSFTNGP04.phx.gbl... > My Dell Inspiron 1520 laptop with Windows Vista Home Premium has failed to > load the subject update on 20 different occasions s...

Refer to SQL statements globally
I have two large SQL statements that I need to use across several forms, reports, etc. Rather than repeat them in each form, I'm trying to store and reference them globally. For example, I'd like to store strSQL1 and strSQL2 in a global module, so I can use either like this in a form: Random form: Me!lstResults.RowSource = strSQL1 Random report: Me.Report.RecordSource = strSQL2 Would I just store the SQL statements in a global module like: Public Function SQLSource() As String Dim strSQL1 As String Dim strSQL2 As String strSQL1 = "SELECT blah blah...

Vista Update freeze at download/installation
Hi there, Since some time, I got a message in Windows Update dialog, telling me that "12 important updates are available". When I push the button "Install updates", it begins to download, but is not able to get anything, until I cancel the process. Please tell me what is happen and how can I fix it. Note that before this problem I run successfully each update, since when I install my OS (2-3 years ago), without problems TIA, Sabin Sabin Coanda wrote: > Hi there, > > Since some time, I got a message in Windows Update dialog, telling me ...

To SQL or not to SQL?
I have a very vertical product developed 100% in M/S Access. I developed it myself in 1993 in the initial release of Access and been with it ever since. It is currently very stable and running in Access 2003. My big question is how or even *if* we should move it to SQL. My customers are getting bigger all the time with more users. Typically our customers run one or two workstations generally never more than 5. Performance, however, is starting to slow with database sizes passing 500 meg. We also have a LOT of code behind forms so are bound tightly to the Access development environ...

Questions #7
Please can anyone help me with a couple of questions I have about am Excel XP spreadsheet I have devised to pass out to other people. 1. I have a graphic on the spreadsheet which I want to make 'delete proof' I have used cell protection and a pass work to protect the sheet, but the graphic is still removeable, is there a cure for this? 2. On the sheet is a graph, the graph itself needs to be protected, but the titles could do with being editable, or linkable to another cell (in a seperate data sheet) that the user could edit to change the titles. I'm not a stranger to VBA, ...

2005 Update failed
Hello, I have the 2005 Money trial version, I downloaded the update, but it failed to install. I cannot open Money with my current money.mny file, only a newly created one. The error is: A communication error occured. Please try your call again. If you cantinue to have problems call your financial institution's Online Services Customer Support. Thanks for the help Frank In microsoft.public.money, Frank wrote: > > >I have the 2005 Money trial version, I downloaded the update, but it failed >to install. I cannot open Money with my current money.mny file, only a ne...

gp 10 end of the year update client computer
I downloaded the latest patch KP961354.v10-enu.msp on the server, and 3 workstations with no issues., on my workstation the patch installs and just before it finishes up, it uninstall itself, I get no error message thanks for any help -- Carol Carol, I would reinstall GP and apply the update on a clean installation. Regards, -- Mohammad R. Daoud MCP, MCBMSP, MCTS, MCBMSS Mob: +962 - 79 -999 65 85 Great Package For Business Solutions daoudm@greatpbs.com http://www.greatpbs.com http://mohdaoud.blogspot.com/ "Carol" wrote: > I downloaded the latest patch KP961354.v10-enu...

MDI, beginner questions
Im trying to find the best way for me to implement multiple mdi child windows with dialog layout. My application will need several dialog windows with different layout (sort of like photoshops toolbar windows). All windows will only occur once so there is no need for any new/open/save functionality. I only need MDI to keep all windows organized. Could someone please help me with a simple code example? I've read a bunch of usenet posts, but I still can't figure out a suitable approach for my type of app. Thanks! Fredrik wrote: > Im trying to find the best way for me to implement ...