using VBScript to open a QueryDef

A

alfaista

i have posted this in the VBScript discussion group, but thought since it was
DAO that someone here may be able to help......here is the last thread of the
post.


thanks so much for your response!!!

i agree, but for most purposes DAO is best with strictly Access as it is the
default library. this is going to remain an Access database because of
customer requirements, so i stuck with the default.

to answer your questions....
1. When you run the qryTestPMC query in the Access Query Builder, do you get
the expected 5 records?
yes, I get the 5 records in Access, i have tested that again and again.
2. Is the query parameterized? no
3. How are you determining that only a single record is returned?
i took out my msgbox, but i have this line:
msgbox "record count =" & recordset.recordcount
4. What is the sql statement in the query?
i have tried to replace the qDef with the SQL statment instead, to see if it
was an issue with the querydef object, same result. here is the statement:
(and yes, i've taken out the &"_"& and tried it without the AS sections, all
same result. grabs the first record perfectly, no more.)

SELECT [Model Descriptor] & "_" & [Global ID] AS ModelDesc,
tblGlobalImportData.SubModel, tblGlobalImportData.[Original File Name] AS
OrgFile, tblGlobalImportData.[Creator of File] AS FileOwner,
qryJobCaseVer.[Job Name] AS JobName, qryJobCaseVer.[Case Name] AS CaseName,
qryJobCaseVer.[Version Name] AS VersionName, tblGlobalImportData.ModelVers
FROM tblModelsLU INNER JOIN (tblGlobalImportData LEFT JOIN qryJobCaseVer ON
(tblGlobalImportData.[Version ID] = qryJobCaseVer.[Version ID]) AND
(tblGlobalImportData.[Case ID] = qryJobCaseVer.[Case ID]) AND
(tblGlobalImportData.[Job ID] = qryJobCaseVer.[Job ID])) ON
tblModelsLU.[Model ID] = tblGlobalImportData.[Model ID];
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top