Want to link to an SQL Server Express table using DOCmd in vba from ACCESS. I have changed some names for security, but the originales are correct-verified by me and others.
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;Driver={SQL Server}; Server=POS1\SQLExpress; Database=sales; Uid=sa;Pwd=ralphy", acTable, "dbo.Transaction_Table", "Transaction_Table"
I get;
"SQL Server Error 4060
Server rejected the connection;Access to the selected database has been denied."
Been working on this off and on for weeks now. I just heard that DoCmd is unreliable. I can link to the tables using an ODbC DSN conection from the ribbon in ACCESS and it works fine. Just can't do it via vba. Plus, I can' find a connection string for linking tables with Set. The above example is supposed to DSNless.
Any help or suggestions would be appreciated.
Thanks
Jpl
DoCmd.TransferDatabase acLink, "ODBC Database", "ODBC;Driver={SQL Server}; Server=POS1\SQLExpress; Database=sales; Uid=sa;Pwd=ralphy", acTable, "dbo.Transaction_Table", "Transaction_Table"
I get;
"SQL Server Error 4060
Server rejected the connection;Access to the selected database has been denied."
Been working on this off and on for weeks now. I just heard that DoCmd is unreliable. I can link to the tables using an ODbC DSN conection from the ribbon in ACCESS and it works fine. Just can't do it via vba. Plus, I can' find a connection string for linking tables with Set. The above example is supposed to DSNless.
Any help or suggestions would be appreciated.
Thanks
Jpl