I am on a mission to populate a MS Access form with data from an SQL Server table. I do not want the SQL Server table to be linked in Access. Doing my Google searching the closes I have gotten is the code below. The only problem is that it requires the SQL Server table to be linked to Access. I know my connection string:
"DRIVER=SQL Server Native Client 11.0;SERVER=65.999.228.253;UID=sa;PWD=123456aA@;DATABASE=Auxiliary_3242_Secretary;" (I Changed password and server in this example).
Can the code below be modified in any way to achieve my goal?
"DRIVER=SQL Server Native Client 11.0;SERVER=65.999.228.253;UID=sa;PWD=123456aA@;DATABASE=Auxiliary_3242_Secretary;" (I Changed password and server in this example).
Can the code below be modified in any way to achieve my goal?
Code:
DoCmd.OpenForm "frm_CashBook_Transaction_Testing"
Set RstCashbook = New ADODB.Recordset
RstCashbook.CursorLocation = adUseClient
RstCashbook.Open "Select * From dbo_vw_Bank_RunningTotal_AllAccounts WHERE Cashbook_Date_ID = " & Nz(TempVars!CashBook_Date_ID, 0) & " Order By Bank_Account_ID, Cashbook_Date_ID, CheckNumber_Numeric, Payee_Payor, Description", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic
Set Forms("frm_CashBook_Transaction_Testing").Recordset = RstCashbook