I should also point out that I'm running the VB Script using the same credentials in VC that I used to test the script manually, which are also the same credentials I've used to log into the computer that VC is running on. I've tried both CScript.exe and WScript.exe, both with shell mode turned on and off. Error code 3151 is "cannot connect to data source <my data source name", but I don't understand why. The data source is set up as a user DSN, but given that everything is running using the same credentials, I don't see how that would matter. What it looks like to me is that WScript.exe is running using the credentials I've specified in the task, but the VBScript file isn't seeing that, so when it opens the ACCDB file, it's running as SYSTEM, which can't see the DSN.
As another test, I added a System DSN and re-linked the query to that one. This time, it ran fine, but that still doesn't seem to make a lot of sense to me.