By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,423 Members | 1,327 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,423 IT Pros & Developers. It's quick & easy.

VBA/SQL - Help!

P: 1
Hey, my query is not working anymore - I think I have put something in the wrong place but would appreciate any help anyone could give. I've just restarted my coding journey so am a bit lost!

Thanks in advance :)
Attached Images
File Type: jpg Capture_LI.jpg (73.6 KB, 19 views)
Feb 25 '20 #1
Share this Question
Share on Google+
2 Replies

P: 112
I took a quick look , I found two mistakes.
First, this source executes
Expand|Select|Wrap|Line Numbers
  1. cn.Execute(StrQuery)
before setting SQL command to "StrQuery".
Second, the
Expand|Select|Wrap|Line Numbers
  1. rs.MoveNext
  2. i = i + 1
statement is not executed in Do loop.This is infinite loop.
Feb 26 '20 #2

Expert Mod 10K+
P: 12,413
That picture is too small and blurry. Copy and paste the code instead.

You also need to supply more information than "not working". That tells us nothing about what's not working. Are you getting an error message? Are you getting incorrect results?
Feb 26 '20 #3

Post your reply

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