<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ralf Eisenreich &#187; VBA</title>
	<atom:link href="http://sqlblog.de/blog/category/vba/feed/" rel="self" type="application/rss+xml" />
	<link>http://sqlblog.de/blog</link>
	<description>SQLBlog.DE &#124; ..things to remember</description>
	<lastBuildDate>Mon, 26 Dec 2011 14:37:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>.Net-Snippets</title>
		<link>http://sqlblog.de/blog/2007/11/net-snippets/</link>
		<comments>http://sqlblog.de/blog/2007/11/net-snippets/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 15:11:25 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[snippets]]></category>

		<guid isPermaLink="false">http://sqlblog.de/blog/index.php/2007/11/29/net-snippets/</guid>
		<description><![CDATA[Unter .Net-Snippets findet man recht gute Lösungen. Sollte man immer mal besuchen, wenn man vor einem Problemchen steht. Außerdem gibt...]]></description>
			<content:encoded><![CDATA[<p><a title="http://dotnet-snippets.de" href="http://dotnet-snippets.de"><img src="http://sqlblog.de/blog/wp-content/uploads/2007/11/net-snippets.jpg" alt=".Net-Snippets" /></a></p>
<p>Unter <a title="dotnet-snippets" href="http://dotnet-snippets.de">.Net-Snippets</a> findet man recht gute Lösungen. Sollte man immer mal besuchen, wenn man vor einem Problemchen steht.</p>
<p>Außerdem gibt es noch ein nettes <a title="http://dotnet-snippets.de/dns/ffplugin.aspx" href="http://dotnet-snippets.de/dns/ffplugin.aspx">Firefox-Search-Plugin</a> zur schnellen Suche.</p>
<p><img src="http://sqlblog.de/blog/wp-content/uploads/2007/11/net-snippets2.jpg" alt=".Net-Snippets" /></p>
]]></content:encoded>
			<wfw:commentRss>http://sqlblog.de/blog/2007/11/net-snippets/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>MS Access: Code verstecken / schuetzen</title>
		<link>http://sqlblog.de/blog/2006/07/ms-access-code-verstecken-schuetzen/</link>
		<comments>http://sqlblog.de/blog/2006/07/ms-access-code-verstecken-schuetzen/#comments</comments>
		<pubDate>Thu, 27 Jul 2006 06:35:31 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[VBA]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[visual basic]]></category>

		<guid isPermaLink="false">http://blog.ralf-eisenreich.de/blog/index.php/2006/07/27/ms-access-code-verstecken-schuetzen/</guid>
		<description><![CDATA[Den VBA-Code (VisualBasic-for-Applications-Code) kann man durch die Erzeugung einer MDE-Datei schuetzen, da dann so etwas wie ein Bytecode erstellt wird,...]]></description>
			<content:encoded><![CDATA[<p>Den VBA-Code (VisualBasic-for-Applications-Code) kann man durch die Erzeugung einer MDE-Datei schuetzen, da dann so etwas wie ein Bytecode erstellt wird, fuer den ich bisher keinen Decompiler finden konnte. (Menue: Tools->Database Utilities->Make MDE-File). Aber Achtung die orginale MDB-Datei sollte immer gesichert werden!<br />
Der integrierte Passwortschutz fuer eigene Projekte ist uebrigens unsicher und leicht zu umgehen.</p>
]]></content:encoded>
			<wfw:commentRss>http://sqlblog.de/blog/2006/07/ms-access-code-verstecken-schuetzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL Server: Integration Services</title>
		<link>http://sqlblog.de/blog/2006/04/sql-server-integration-services/</link>
		<comments>http://sqlblog.de/blog/2006/04/sql-server-integration-services/#comments</comments>
		<pubDate>Sun, 09 Apr 2006 13:08:18 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[ssis]]></category>

		<guid isPermaLink="false">http://ralf-eisenreich.de/blog/index.php/2006/04/09/sql-server-integration-services/</guid>
		<description><![CDATA[Die SQL Server Integration Services erlauben das Zusammenfuehren von Daten aus heterogenen Datenquellen. Um den Ueberblick zu behalten wird der...]]></description>
			<content:encoded><![CDATA[<p>Die SQL Server Integration Services erlauben das Zusammenfuehren von Daten aus heterogenen Datenquellen. Um den Ueberblick zu behalten wird der gesamte Datenfluss grafisch dargestellt und modelliert.</p>
<p>Das finde ich klasse, denn gerade wenn man ein Projekt an eine weitere Person uebergeben muss oder selbst an mehreren Projekten arbeitet, behaelt man durch diese kleine Hilfe den Ueberblick besser.</p>
<p><a class="imagelink" title="SQL Server Integration Services" href="http://ralf-eisenreich.de/blog/wp-content/uploads/2006/04/sql_server_integration_services.jpg"><img id="image40" alt="SQL Server Integration Services" src="http://ralf-eisenreich.de/blog/wp-content/uploads/2006/04/sql_server_integration_services.thumbnail.jpg" /></a></p>
<p>An manchen Stellen wird es trotzdem notwendig sein, Programmierfaehigkeiten mitzubringen. Dazu kann dann die Scriptkomponente benutzt werden. Mit folgendem Script kann man auf die Datenquellen in seinem Projekt zugreifen. Aber Achtung es muss eine <em>OLEDB</em>-Verbindung definiert werden!</p>
<p><code><br />
' initialize connection<br />
Me.myConnection = DirectCast(Dts.Connections("SERVER.Database.root.ADO").AcquireConnection(Dts.Transaction), SqlClient.SqlConnection)<br />
' -- open connection to database --<br />
Try<br />
If Not (myConnection.State.Open = ConnectionState.Open) Then<br />
myConnection.Open()<br />
End If<br />
Catch ex As Exception<br />
MsgBox("Could not open connection to DataBase: " &#038; ex.Message.ToString)<br />
End Try<br />
' -- define data tables --<br />
Dim tblTabelle As New Data.DataTable<br />
' -- define SQL-commands --<br />
Dim cmdSQLTblTabelle As New SqlClient.SqlCommand<br />
cmdSQLTblTabelle.CommandText = "SELECT * FROM tblTabelle;"<br />
cmdSQLTblTabelle.Connection() = myConnection<br />
' -- define DataAdapters --<br />
Dim myDATblTabelle As SqlClient.SqlDataAdapter(cmdSQLTblTabelle)<br />
' -- get data from tables --<br />
myDATblTabelle.FillSchema(tblTabelle, SchemaType.Mapped)<br />
myDATblTabelle.Fill(tblTabelle)<br />
' generate InsertCommand automatically with Commandbuilder<br />
Dim myCommandBuilder As New SqlClient.SqlCommandBuilder(myDATblTabelle)<br />
' show rows of query<br />
msgbox("rows: " &#038; tblTabelle.Rows.Count)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sqlblog.de/blog/2006/04/sql-server-integration-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS Access: Multiselect in Queries</title>
		<link>http://sqlblog.de/blog/2006/04/ms-access-multiselect-in-queries/</link>
		<comments>http://sqlblog.de/blog/2006/04/ms-access-multiselect-in-queries/#comments</comments>
		<pubDate>Sat, 08 Apr 2006 15:45:43 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://ralf-eisenreich.de/blog/index.php/2006/04/08/ms-access-multiselect-in-queries/</guid>
		<description><![CDATA[In MS Access verwendet man in den Benutzerschnittstellen gern Listen mit Multiselect-Funktion, um dem Anwender flexiblere AuswahlmÃ¶glichkeiten zu bieten. In...]]></description>
			<content:encoded><![CDATA[<p>In MS Access verwendet man in den Benutzerschnittstellen gern Listen mit Multiselect-Funktion, um dem Anwender flexiblere AuswahlmÃ¶glichkeiten zu bieten.</p>
<p>In Queries ist es jedoch etwas schwierig diese Optionen abzufragen. Folgende VBA-Funktion schafft da Abhilfe:<br />
<code><br />
Function InMultiSelect(frms, ctrl As String, col As Integer, data As Variant, ParamArray OtherArgs()) As Boolean<br />
'Checks whether a Variant (data or OtherArgs) is included in the specified column (col) of a ListBox (ctrl)<br />
'in a certain Form (frms)<br />
On Error GoTo Error_InMultiSelect<br />
Dim varItm As Variant<br />
Dim index As Integer<br />
Dim ctl As Control<br />
Dim frm As Form<br />
Set frm = Forms(frms)<br />
Set ctl = frm.Controls(ctrl)<br />
InMultiSelect = False<br />
For Each varItm In ctl.ItemsSelected<br />
If InMultiSelect = True Then Exit For<br />
If CStr(data) = CStr(ctl.Column(col, varItm)) Then InMultiSelect = True<br />
For index = LBound(OtherArgs) To UBound(OtherArgs)<br />
If InMultiSelect = True Then Exit For<br />
If CStr(OtherArgs(index)) = CStr(ctl.Column(col, varItm)) Then InMultiSelect = True<br />
Next index<br />
Next varItm<br />
Exit Function<br />
Error_InMultiSelect:<br />
InMultiSelect = False<br />
Exit Function<br />
End Function<br />
</code></p>
<p>In den Abfragen (Queries) selbst wird diese Funktion dann beispielsweise so aufgerufen:</p>
<p><code><br />
SELECT *<br />
FROM [tblTabelle]<br />
WHERE InMultiSelect("[frmFormMitMultiSelectAuswahl]","[lstListeMitMultiSelectAuswahl]",0,[tblTabelle].[Spalte]))&lt;&gt;False);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sqlblog.de/blog/2006/04/ms-access-multiselect-in-queries/feed/</wfw:commentRss>
		<slash:comments>28</slash:comments>
		</item>
		<item>
		<title>MS Access: IF EXISTS DROP TABLE</title>
		<link>http://sqlblog.de/blog/2006/04/ms-access-if-exists-drop-table/</link>
		<comments>http://sqlblog.de/blog/2006/04/ms-access-if-exists-drop-table/#comments</comments>
		<pubDate>Sat, 08 Apr 2006 15:20:30 +0000</pubDate>
		<dc:creator>Ralf</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://ralf-eisenreich.de/blog/index.php/2006/04/08/ms-access-if-exists-drop-table/</guid>
		<description><![CDATA[Leider ist es in MS Access nicht ohne weiteres möglich das Vorhandensein einer Tabelle abzufragen. Dies wird gerade wenn man...]]></description>
			<content:encoded><![CDATA[<p>Leider ist es in MS Access nicht ohne weiteres möglich das Vorhandensein einer Tabelle abzufragen.</p>
<p>Dies wird gerade wenn man mit temporÃ¤ren Tabellen arbeitet zum Problem.</p>
<p>Eine Abhilfe liefert folgende VBA-Funktion:<br />
<code><br />
' check if a table exists<br />
Function tableExists(tableName As String) As Boolean<br />
On Error GoTo Error_tableExists<br />
Dim strTableName<br />
' assign tableName to String<br />
strTableName = CurrentDb.TableDefs(tableName)<br />
' if no error occurs then set tableExists to true<br />
tableExists = True<br />
Exit_tableExists:<br />
On Error Resume Next<br />
Exit Function<br />
Error_tableExists:<br />
Select Case Err.Number<br />
Case 3265  'Item not found in this collection<br />
tableExists = False<br />
Resume Exit_tableExists<br />
Case Else<br />
MsgBox "Error " &#038; Err.Number &#038; ": " &#038; Err.Description, vbCritical<br />
Resume Exit_tableExists<br />
End Select<br />
End Function<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sqlblog.de/blog/2006/04/ms-access-if-exists-drop-table/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

