[AccessD] Sample .accdb - three posts (Part 3) - Re[2]: VBA7?

Salakhetdinov Shamil mcp2004 at mail.ru
Wed Feb 10 11:00:19 CST 2016


 Hi Lambert --

Try "concealed weapon" - .SaveAsText e.g.

Access.Application.SaveAsText acQuery, "Query1", "S:\Projects\Databases\Query1.qdf.txt"

The result .text file has to be parsed but it's obvious what information about query it keeps: together with QueryDef's properties available via VBA/DAO this text file has all information about a query design and the parts/objects of the source .mdb/.accdb it depends on/relates to.

HTH,

-- Shamil

>Wednesday, February 10, 2016 4:39 PM UTC from "Heenan, Lambert" <Lambert.Heenan at aig.com>:
>
>Thanks Shamil,
>
>I found that the code produced results in another accdb file, not sure what the deal was with the first one I tried.
>
>It's a handy peice of code, but I found is that it does not quite report on all fields.
>
>If it is looking at a query that groups by some columns and Sums others it does not report all.  For instance this query
>
>SELECT Table1.T1PKID, Table1.ID_WavesBatch AS Batch, Sum(Table1.cPaymentAmt) AS Amount, Table2.sCoverage
>FROM (Table1 INNER JOIN Table2 ON Table1.Payment_Type_ID = Table2.ID_Payment_Type) INNER JOIN SubQuery ON Table1.T1PKID = [SubQuery].T1PKID
>WHERE (((Table1.Payment_Type_ID)=30 Or (Table1.Payment_Type_ID)=31))
>GROUP BY Table1.T1PKID, Table1.ID_WavesBatch, Table2.sCoverage
>HAVING (((Table1.ID_WavesBatch) Is Not Null));
>
>The code will report that Table1.T1PKID and Table1.ID_WavesBatch are fields 1 and 2, but the third field, with the Sum, will be shown as simply a period and then the fourth field will be shown as Table2.sCoverage. The sub query ' SubQuery' is not mentioned at all, nor the column used in the Where clause, Table1.Payment_Type_ID.
>
>Lambert
>
>-----Original Message-----
>From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Salakhetdinov Shamil
>Sent: Wednesday, February 10, 2016 11:17 AM
>To: Access Developers discussion and problem solving
>Subject: [AccessD] Sample .accdb - three posts (Part 3) - Re[2]: VBA7?
>
> Hi Lambert --
>
>Here is the sample C# code to decode and unzip sample .accdb - the code can be run using e.g. LINQPad (  http://www.linqpad.net/ ) - free.
><snip>
></end snip>
>Thank you.
>
>-- Shamil
>
>>Wednesday, February 10, 2016 3:00 PM UTC from "Heenan, Lambert" < Lambert.Heenan at aig.com >:
>>
>>Curious. Certainly not working with Access 2010 accdb files.
>>
>>At least not on my end. 
>>
>>Lambert
>> 
>-- 
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website:  http://www.databaseadvisors.com



More information about the AccessD mailing list