Created
April 19, 2012 18:51
-
-
Save stimms/2422966 to your computer and use it in GitHub Desktop.
Getting a connection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function GetSQLServerConnection() As Connection | |
Dim con As Connection | |
Set con = New Connection | |
con.connectionString = CurrentDb.TableDefs(10).Connect | |
con.Open | |
Set GetSQLServerConnection = con | |
End Function | |
.... | |
cmd.ActiveConnection = GetSQLServerConnection | |
cmd.CommandText = finalCommand | |
cmd.Execute | |
cmd.ActiveConnection.Close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment