<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; VBS поиск в Recordset]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=9461</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=9461&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «VBS поиск в Recordset».]]></description>
		<lastBuildDate>Mon, 07 Apr 2014 11:20:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: VBS поиск в Recordset]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=81556#p81556</link>
			<description><![CDATA[<p>Спс <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />)</p>]]></description>
			<author><![CDATA[null@example.com (inock)]]></author>
			<pubDate>Mon, 07 Apr 2014 11:20:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=81556#p81556</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS поиск в Recordset]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=81547#p81547</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Есть набор записей.</p></blockquote></div><p>Откуда он берётся?</p><p><em>Update:</em> Если извне — используйте условия в запросе SQL. Если, как в примере, формируется «ручками» — свойство «.Filter». И там, и там результат — в свойстве «.RecordCount».<br /></p><div class="codebox"><pre><code>Option Explicit

Const adFilterNone = 0

With WScript.CreateObject(&quot;ADODB.Recordset&quot;)
    .Fields.Append &quot;User&quot;,200,150
    .Open
    
    .AddNew : .Fields.Item(&quot;User&quot;) = &quot;123&quot;
    .AddNew : .Fields.Item(&quot;User&quot;) = &quot;456&quot;
    
    .Filter = &quot;User=&#039;123&#039;&quot;
    WScript.Echo .RecordCount
    
    .Filter = &quot;User=&#039;456&#039;&quot;
    WScript.Echo .RecordCount
    
    .Filter = &quot;User=&#039;789&#039;&quot;
    WScript.Echo .RecordCount
    
    .Filter = adFilterNone
    WScript.Echo .RecordCount
End With

WScript.Quit 0
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Mon, 07 Apr 2014 09:45:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=81547#p81547</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS поиск в Recordset]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=81542#p81542</link>
			<description><![CDATA[<div class="quotebox"><cite>alexii пишет:</cite><blockquote><p>А Вы расскажите глобальную цель. Я уж не припомню сколько .Seek не пользовал.</p></blockquote></div><p>Цель простая. Есть набор записей. Нужно проверить, есть ли конкретная фамилия в этом наборе. Если есть - одно. Если нет - другое. Тупо перебором - долго imho.</p>]]></description>
			<author><![CDATA[null@example.com (inock)]]></author>
			<pubDate>Mon, 07 Apr 2014 09:22:47 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=81542#p81542</guid>
		</item>
		<item>
			<title><![CDATA[Re: VBS поиск в Recordset]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=81540#p81540</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>На сколько я понимаю, seek не заработает sad</p></blockquote></div><p>Правильно понимаете — <a href="http://support.microsoft.com/kb/287638/en-us">How to use the Seek method with ActiveX Data Objects (ADO) against a Jet recordset</a>:<br /></p><div class="quotebox"><blockquote><p>Additionally, you can use the Seek method only when a recordset is accessing the table directly. In this example, the recordset is instructed to access the table directly by the adCmdTableDirect argument in the Open method. You cannot use the Seek method on objects such as queries and linked tables. You can use the Seek method only on native Microsoft Jet tables. If your database contains linked tables, you can open an external connection to the back-end database that stores the table, and then use the Seek method directly on the table.</p></blockquote></div><div class="quotebox"><blockquote><p>Какие есть альтернативы?</p></blockquote></div><p>А Вы расскажите глобальную цель. Я уж не припомню сколько .Seek не пользовал.</p>]]></description>
			<author><![CDATA[null@example.com (alexii)]]></author>
			<pubDate>Mon, 07 Apr 2014 09:15:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=81540#p81540</guid>
		</item>
		<item>
			<title><![CDATA[VBS поиск в Recordset]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=81536#p81536</link>
			<description><![CDATA[<p>На сколько я понимаю, seek не заработает <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /><br />Какие есть альтернативы?</p><div class="codebox"><pre><code>C:\temp&gt;type ab.vbs
Set UsersIT = CreateObject(&quot;ADODB.Recordset&quot;)
    UsersIT.Fields.Append &quot;User&quot;,200,150
    UsersIT.Open

    UsersIT.AddNew
    UsersIT(&quot;User&quot;) = &quot;123&quot;
    UsersIT.Update

    UsersIT.AddNew
    UsersIT(&quot;User&quot;) = &quot;456&quot;
    UsersIT.Update

x = &quot;123&quot;
UsersIT.Seek &quot;=&quot;, x
 If UsersIT.NoMatch Then
    MsgBox &quot;No&quot;
 Else
    MsgBox &quot;Yes&quot;
 End If

C:\temp&gt;cscript ab.vbs
Сервер сценариев Windows (Microsoft R) версия 5.8
c Корпорация Майкрософт (Microsoft Corp.), 1996-2001. Все права защищены.

C:\temp\ab.vbs(14, 1) ADODB.Recordset: Текущий поставщик не поддерживает необходимый интерфейс для функции Index.
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (inock)]]></author>
			<pubDate>Mon, 07 Apr 2014 07:46:02 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=81536#p81536</guid>
		</item>
	</channel>
</rss>
