访问查询问题。 [英] Access Query Problem.

查看:68
本文介绍了访问查询问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


包含110个passthru查询的MDB文件

运行每个查询并将其保存在excel中..


我已经编写了VBcode ....我的代码适用于普通查询..但我所有的查询都使用case,substr和sooo ..所以如果你看到访问不理解case,substr ..如果你想要访问运行这样的查询然后你必须使它们作为passthru查询..那么查询将工作正常..如果我想通过VB运行相同的查询它'抛出错误(sytax错误)..所以我问题是如何在VB中处理这样的查询...


以下是我为您提供的一个示例查询....


示例查询

------------

展开 | 选择 | Wrap | 行号

解决方案

您可以尝试以下任一方法:
  • 有一个模板直通查询,并根据需要通过QueryDef.SQL属性更改它的SQL属性。
  • 打开与外部RDBMS的连接,在此连接上执行查询以获取记录集并将如此获得的记录集导出到Excel。


问候,


嗨鱼,


你能为我提供一些时间..所以我可以解释我在做什么......


嗨鱼,

$ b以下$ b是我正在做的函数...

展开 < span class =codeDivider> | 选择 | Wrap | Line编号

Hi All,

MDB file with 110 passthru queries
Run each query and save it in excel..

I had already written VBcode.... my code works fine for normal queries.. but all my queries using case, substr, and sooo.. so if you see access won''t understand case, substr.. if you want access to run such queries then you have to make them as passthru queries.. then the query will work fine.. if i want same query to run thru VB it''s throwing error (sytax error) .. so my problem is how to handle such queries in VB...

Below is the one sample query i provided for you ref ....


Sample query
------------

Expand|Select|Wrap|Line Numbers

解决方案

You may try either of the following:
  • Have a one template passthrough query and change it SQL property as needed via QueryDef.SQL property.
  • Open connection to the external RDBMS, execute query on this connection to get recordset and export thus obtained recordset to Excel.

Regards,
Fish


Hi Fish,

could you pls offer some time for me.. so that i can explain what iam doing plss....


Hi Fish,

below is the function how iam doing ...

Expand|Select|Wrap|Line Numbers


这篇关于访问查询问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆