ADODB。打开问题 [英] ADODB .Open Problem
问题描述
您好!我整天都在阅读文章,但仍然没有得到解释为什么会发生这种情况。我在msaccess中使用ADO并与ADODB建立连接,我已成功实现,但现在我想使用Movefirst和和MoveNext记录集的方法使用未绑定的文本,所以我在VB中编写了一个简单的函数代码。现在,我的困境从这里开始。我想我一开始就做对了,但是当我运行数据库时,我没有输出任何内容,我的意思是当单击NEXT命令按钮时,我的文本字段中没有显示任何内容。我把我的代码放在这里,所以请。有心的人帮助我。
谢谢!
< blockquote>嗨
这很好用!第一次!
我自己仍然主要使用DAO所以有兴趣看看这个。
我设置了一个dataPMC.mdb包含您描述的一个表和四个字段。我添加了三条记录然后关闭它。
我在另一个''test-bed''数据库中创建了一个新表单,添加了一个按钮,3个文本框和一个复选框(用于Compliant)然后在按钮下粘贴你的代码。
我以为我将不得不写一个With myTableRS。在Me.TxtWorkOrder = myTableRS!Workorder周围但是它没有工作正常。
对不起,你的问题无法解决。
S7
>
嗨再次
作为后期脚本;我无法理解为什么你需要在设置Connection时运行一些sql,然后单独设置一个Recordset来打开表格。
答案是你不要 ;;我注释掉了conn.Execute sql。它仍然可以正常工作。
我很想开一个''查询''而不是一个表,所以我修改了''open recordset''语句来引用''sql ''而不是'tbliw49"并且它不起作用,说''FROM FROM中的错误''。然后我注意到你正在使用一个常量''adCmdTable'',这在运行查询时显然是错误的,但是当我查找要将其更改为什么时,我的''帮助''说它不应该在那里。这有效; -
展开 | 选择 | Wrap | 行号
请记住为任何已启动的线程提供有意义的标题(请为新主题使用适当的标题!)。这有助于确保其他成员以及普通公众更有机会找到任何类似问题的答案。
ADMIN。
Hello! I have been reading articles all day and still do not get an explanation WHY is this happening. I''m using ADO in msaccess and set up a connection with ADODB, which I have successfully achieved, but now I want to use the "Movefirst " and "MoveNext" method of the recordset using an unbound text, so I wrote a simple function code in VB. Now my dilema starts here. I think I got it right at first, but when I run the database, I got nothing for an output, I mean nothing shows up in my text field when the NEXT command button is clicked. I placed my code here, so pls. anyone with a good heart to help me.
Thanks!
Expand|Select|Wrap|Line Numbers解决方案Hi
This works fine! First time too !
I''m still mostly using DAO myself so was interested having a look at this.
I set up a dataPMC.mdb with the one table and four fields you describe. I added three records then closed it.
I created a new form in another ''test-bed'' database, added a button, 3 text boxes and a checkbox (for Compliant), then pasted your code under the button.
I thought I was going to have to write a "With myTableRS" around the "Me.TxtWorkOrder = myTableRS!Workorder" bit, but it worked ok without.
Sorry can''t help with your problem.
S7
Hi again
As a Post Script; I could not understand why you needed to run some sql when setting up the Connection, then separately setting up a Recordset to open the table.
The answer is "you don''t"; I commented out the "conn.Execute sql" and it still works fine.
I was curious to open a ''query'' rather than a table so I modified your ''open recordset'' statement to refer to ''sql'' rather than "tbliw49" and it would not work, saying ''Error in FROM clause''. I then noted that you are using a constant ''adCmdTable'' which is obviously wrong when running a query, but when I looked-up to find what to change it to, my ''Help'' says it should not be there anyway. This works;-
Expand|Select|Wrap|Line Numbers
Please remember to provide a meaningful Title for any threads started (Please Use Appropriate Titles for New Threads!). This helps to ensure that other members, and also the general public, will have a better chance of finding answers to any similar questions.
ADMIN.
这篇关于ADODB。打开问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文登录 关闭
扫码关注1秒登录发送“验证码”获取 | 15天全站免登陆