<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=263869</guid>
        <pubDate>Mon, 15 Dec 2003 14:11:06 +0000</pubDate>
        <title>Создание файла БД Access средствами ADO</title>
        <link>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=263869</link>
        <description><![CDATA[Петрович:  Кому интересно, нашел еще один способ покороче, хотя суть от этого не меняется <!--emo&:)--><img src='http://forum.sources.ru/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo--> :<br><br><!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b></b> </td></tr><tr><td id='CODE'><!--ec1-->const<br>&nbsp; CLASS_DBEngine&#58; TGUID = &#39;{00000100-0000-0010-8000-00AA006D2EA4}&#39;;<br>&nbsp; dbLangCyrillic = &#39;;LANGID=0x0409;CP=1252;COUNTRY=0&#39;;<br>&nbsp; dbOption &nbsp; &nbsp; &nbsp; = &nbsp; &nbsp; 0<br>// &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;or &#036;20 // ? похоже создание в формате Access 97<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#59;<br><br>procedure CreateMSAccessDatabase&#40;FileName &#58;String&#41;;<br>begin<br>&nbsp; Variant&#40;CreateOleObject&#40;ClassIDToProgID&#40;CLASS_DBEngine&#41;&#41;&#41;<br>&nbsp; &nbsp; .Workspaces&#91;0&#93;<br>&nbsp; &nbsp; &nbsp; .CreateDatabase &#40;FileName, dbLangCyrillic, dbOption&#41;;<br>end;<!--c2--></td></tr></table><div class='postcolor'><!--ec2--><br> ]]></description>
        <author>Петрович</author>
        <category>Delphi: Базы данных</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261786</guid>
        <pubDate>Thu, 11 Dec 2003 19:29:22 +0000</pubDate>
        <title>Создание файла БД Access средствами ADO</title>
        <link>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261786</link>
        <description><![CDATA[Петрович:  <!--QuoteBegin--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>Цитата</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin--><b>Vit</b>, 11.12.03, 16:06<br>через DAO можно примерно <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd--><br>Спасибо, попробую.<br>Особенно спасибо за <b>&#39;;LANGID=0x0409;CP=1252;COUNTRY=0&#39;</b> - этого я не смог найти в хелпах <!--emo&:(--><img src='http://forum.sources.ru/html/emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /><!--endemo--><br> ]]></description>
        <author>Петрович</author>
        <category>Delphi: Базы данных</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261553</guid>
        <pubDate>Thu, 11 Dec 2003 13:06:40 +0000</pubDate>
        <title>Создание файла БД Access средствами ADO</title>
        <link>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261553</link>
        <description><![CDATA[Vit:  Через ADO не знаю, через DAO можно примерно так:<br><br><!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b></b> </td></tr><tr><td id='CODE'><!--ec1-->procedure CreateMSAccessDatabase&#40;filename&#58; string&#41;; <br>var DAO&#58; Variant; <br> &nbsp;i&#58; integer; <br>const Engines&#58; array&#91;0..2&#93; of string = &#40;&#39;DAO.DBEngine.36&#39;, &#39;DAO.DBEngine.35&#39;, &#39;DAO.DBEngine&#39;&#41;; <br><br> &nbsp;function CheckClass&#40;OLEClassName&#58; string&#41;&#58; boolean; <br> &nbsp;var Res&#58; HResult; <br> &nbsp;begin <br> &nbsp; &nbsp;Result &#58;= CoCreateInstance&#40;ProgIDToClassID&#40;OLEClassName&#41;, nil, CLSCTX_INPROC_SERVER or CLSCTX_LOCAL_SERVER, IDispatch, Res&#41; = S_OK; <br> &nbsp;end; <br>begin <br> &nbsp;for i &#58;= 0 to 2 do <br> &nbsp; &nbsp;if CheckClass&#40;Engines&#91;i&#93;&#41; then <br> &nbsp; &nbsp; &nbsp;begin <br> &nbsp; &nbsp; &nbsp; &nbsp;DAO &#58;= CreateOleObject&#40;Engines&#91;i&#93;&#41;; <br> &nbsp; &nbsp; &nbsp; &nbsp;DAO.Workspaces&#91;0&#93;.CreateDatabase&#40;filename, &#39;;LANGID=0x0409;CP=1252;COUNTRY=0&#39;, 32&#41;; <br> &nbsp; &nbsp; &nbsp; &nbsp;exit; <br> &nbsp; &nbsp; &nbsp;end; <br> &nbsp;raise Exception.Create&#40;&#39;DAO engine could not be initialized&#39;&#41;; <br>end; <!--c2--></td></tr></table><div class='postcolor'><!--ec2--><br><br>А вообще не мучайся, гораздо проще подшить пустую базу данных в ресурсы и дело с концом... ]]></description>
        <author>Vit</author>
        <category>Delphi: Базы данных</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261353</guid>
        <pubDate>Thu, 11 Dec 2003 07:55:00 +0000</pubDate>
        <title>Создание файла БД Access средствами ADO</title>
        <link>https://forum.sources.ru/index.php?showtopic=40316&amp;view=findpost&amp;p=261353</link>
        <description><![CDATA[Петрович:  А не подскажет-ли кто, как мне создать новый файл базы данных MS Access из программы на Delphi либо средствами ADO, либо средствами ActiveX. Желательно краткий пример или ссылка на таковой.<br>В <b>MSDN </b>и <b>DAO360.chw</b> вычитал про объект DBEngine (даже пример есть), но там используются ряд констант типа <b>dbLangGeneral</b>, значения которых я там не нашел <!--emo&:(--><img src='http://forum.sources.ru/html/emoticons/sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /><!--endemo-->. ]]></description>
        <author>Петрович</author>
        <category>Delphi: Базы данных</category>
      </item>
	
      </channel>
      </rss>
	