asked on
Dim wrkODBC As Workspace
Dim conORAP039 As Connection
Function Some_Function()
SetConnectionObject
'Run GetVehicleModels_Connection query "VEHICLE_MODEL" on 'Lists' worksheet
Sheets("Lists").Range("A1").QueryTable.Refresh BackgroundQuery:=False
End Function
Private Sub SetConnectionObject()
' Create ODBCDirect Workspace object and open Connection objects.
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "xxxxxx", "xxxxxx", dbUseODBC)
Workspaces.Append wrkODBC
' Note: The DSNs referenced below must be configured to
' use Microsoft Windows NT Authentication Mode to
' authorize user access to the Microsoft SQL Server.
Set conORAP039 = wrkODBC.OpenConnection("ORAP039", dbDriverNoPrompt, True, _
"ODBC;DATABASE=ORAP039;UID=xxxxxx;PWD=xxxxxx;DSN=ORAP039")
End Sub
ASKER
ASKER
ASKER
ASKER
ASKER
ASKER
Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.
TRUSTED BY