473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

SQL to VBA not working

Brilstern
208 100+
Not sure what I am missing. Need a second pair of eyes on this. I have an update query that is working fine and will update about 40 rows. When I move this over to VBA... no luck. 0 Records. What did I mess up?

SQL
Expand|Select|Wrap|Line Numbers
  1. UPDATE tblTopVulnMachines SET tblTopVulnMachines.OSCPE = "Microsft Windows 7 SP1 x64 Enterprise"
  2. WHERE (((tblTopVulnMachines.OSCPE)="cpe:/o:microso​ft:windows​_7::sp1:x64-enterpr​ise"));
VBA
Expand|Select|Wrap|Line Numbers
  1. strSQLUpdate = "UPDATE tblTopVulnMachines SET tblTopVulnMachines.OSCPE = ""Microsft Windows 7 SP1 x64 Enterprise"" WHERE " & _
  2.                "(((tblTopVulnMachines.OSCPE)=""cpe:/o:microsoft:windows_7::sp1:x64-enterprise""));"
  3.  
  4. DoCmd.RunSQL strSQLUpdate
Mar 17 '15 #1
10 1257
Rabbit
12,516 Expert Mod 8TB
Try using single quotes to delineate strings. The standard is single quotes but the access query builder will accept both whereas any other SQL engine usually doesn't.
Mar 17 '15 #2
Brilstern
208 100+
Thanks Rabbit! Unfortunately no change in results. It still isn't matching any records.
Mar 17 '15 #3
jforbes
1,107 Expert 1GB
Might try removing all the Parenthesis. You don't need them and Access really gets carried away with them.
Mar 17 '15 #4
jforbes
1,107 Expert 1GB
Also, the value that is being Updated is also in the Where Clause, meaning the records will only be updated once. Unless new records are added.
Mar 17 '15 #5
Brilstern
208 100+
No luck with that either JF. I also tried declaring the values in strings and parsing that through the SQL and no change. Not sure what I am missing here.
Mar 17 '15 #6
Brilstern
208 100+
This is a repeated process when information is imported to the database so the occurrence won't be an issue.
Mar 17 '15 #7
Rabbit
12,516 Expert Mod 8TB
You said earlier that the update query "will" update 40 rows. Did you let it or did you cancel the update?
Mar 17 '15 #8
Brilstern
208 100+
I did but I have refreshed the data. I Truncate and re-import all my data each time to ensure I have clear data. The values are back to "cpe:/o:microso​ft:windows​_7::sp1:x64-enterpr​ise"
Mar 17 '15 #9
jforbes
1,107 Expert 1GB
Other things to try:
  • Replace DoCmd.RunSQL with CurrentDB.Execute
  • Add a From Clause
  • You might want to break the code and debug.print strSQLUpdate. Then you can copy and paste it into a new query and fiddle around with it. Possibly convert it into a Select and see if it returns records.
Mar 17 '15 #10
Brilstern
208 100+
Ok thanks for the troubleshooting suggestions, I'll check those out and hit y'all back.
Mar 17 '15 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Mullin Yu | last post by:
hi, i have a web service that has file operations on Windows OS, and there may be a file concurrency issue if only one working directory e.g. c:\working therefore, i want to have a unique sub...
5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
4
by: qbproger | last post by:
I'm developing a plugin for some software. The previous version of the software didn't require a start in directory to be set. This allowed me to leave the working directory to the default in the...
3
by: Jason Huang | last post by:
Hi, In our C# Windows Form application, we are using the SQL Server 2000 as the database server. The Database table MyTable has a field RegistrationDate which represents the Date a client comes...
0
by: WORKING IN FAITH | last post by:
three years I LOVE You Monica More options 1 message - Collapse all WORKING IN FAITH View profile More options Nov 13, 11:29 am three years I LOVE You Monica
3
by: lds | last post by:
On our server we have both applications that have been migrated to use v2.0 of the framework as well as apps that have not yet been migrated and still use 1.1. When I tried to deploy my v2.0 app...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.