<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBS Проверка соединения с БД через ADODB]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6599&amp;type=atom" />
	<updated>2011-12-26T08:44:13Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6599</id>
		<entry>
			<title type="html"><![CDATA[Re: VBS Проверка соединения с БД через ADODB]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54973#p54973" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Mat Skywalker пишет:</cite><blockquote><p>…только возвращать номер ошибки не смысла, он всегда 0, что бы я не &quot;портил&quot;.</p></blockquote></div><p><strong>Mat Skywalker</strong>, это я ошибся в предыдущем коде. Поменяйте местами:<br /></p><div class="codebox"><pre><code>MsgBox &quot;Error: &quot; &amp; CStr(Err.Number)
On Error GoTo 0</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-12-26T08:44:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54973#p54973</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS Проверка соединения с БД через ADODB]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54972#p54972" />
			<content type="html"><![CDATA[<p>Спасибо.<br />Все получилось, только возвращать номер ошибки не смысла, он всегда 0, что бы я не &quot;портил&quot;.</p>]]></content>
			<author>
				<name><![CDATA[Mat Skywalker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26275</uri>
			</author>
			<updated>2011-12-26T08:15:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54972#p54972</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: VBS Проверка соединения с БД через ADODB]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54971#p54971" />
			<content type="html"><![CDATA[<p>Если всё происходит именно так, как Вы описали, то просто обрабатывайте ошибки, наподобие:<br /></p><div class="codebox"><pre><code>…
Set IBConn = CreateObject(&quot;ADODB.Connection&quot;)

On Error Resume Next

IBConn.Open (&quot;Data Source = SM_IB&quot;) 

If Err.Number &lt;&gt; 0 Then
    On Error GoTo 0
    MsgBox &quot;Error: &quot; &amp; CStr(Err.Number)
Else
    On Error GoTo 0
    MsgBox &quot;Соединение удалось&quot;
End If</code></pre></div>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-12-26T07:48:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54971#p54971</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBS Проверка соединения с БД через ADODB]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54970#p54970" />
			<content type="html"><![CDATA[<p>Собственно сабж. Имеется вот такой код:</p><div class="codebox"><pre><code>
Set IBConn = CreateObject(&quot;ADODB.Connection&quot;)  
IBConn.Open (&quot;Data Source = SM_IB&quot;) 
MsgBox &quot;Соединение удалось&quot;</code></pre></div><p>Источник данных находится на другой машине. Если связь с ней есть, то видим сообщение &quot;Соединение удалось&quot;. Если связи нет, то видим ошибку ODBC <img src="//forum.script-coding.com/img/smilies/sad.png" width="15" height="15" /></p><p>Вот и вопрос: как сделать попытку соединения?</p>]]></content>
			<author>
				<name><![CDATA[Mat Skywalker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26275</uri>
			</author>
			<updated>2011-12-26T07:27:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54970#p54970</id>
		</entry>
</feed>
