Hi
Basically, i have an ODBC query and i would like to hardcode the server username and password into VBA.
Code:
--------------------------------------------------------------------------------
Dim qt As QueryTable
Set qt = ActiveSheet.QueryTables(1)
qt.CommandText = "SELECT slitemm.customer," _
& " [item_no] AS [Invoice Number], [refernce] AS [2nd Ref], " _
& "[dated] AS [Invoice Date], [kind] AS [Type], " _
& "[unall_amount] AS [Amount], slitemm.open_indicator" & vbNewLine _
& "FROM scheme.slitemm slitemm" & vbNewLine _
& sqlWH _
& "ORDER BY slitemm.customer, slitemm.dated, slitemm.item_no"
qt.Refresh
--------------------------------------------------------------------------------
The popup requires people to enter a username and password. I'd like that to be put in the code, but i don't know how to manage it.
Basically, i have an ODBC query and i would like to hardcode the server username and password into VBA.
Code:
--------------------------------------------------------------------------------
Dim qt As QueryTable
Set qt = ActiveSheet.QueryTables(1)
qt.CommandText = "SELECT slitemm.customer," _
& " [item_no] AS [Invoice Number], [refernce] AS [2nd Ref], " _
& "[dated] AS [Invoice Date], [kind] AS [Type], " _
& "[unall_amount] AS [Amount], slitemm.open_indicator" & vbNewLine _
& "FROM scheme.slitemm slitemm" & vbNewLine _
& sqlWH _
& "ORDER BY slitemm.customer, slitemm.dated, slitemm.item_no"
qt.Refresh
--------------------------------------------------------------------------------
The popup requires people to enter a username and password. I'd like that to be put in the code, but i don't know how to manage it.