I need to connect to a SQL Server table from MS Access. The table name in Access is 123 but the SQL Server table name is 123_v_username. I need the table name (123) to stay the same in Access but only change the connection string from SQL Server to change to 123_v_username. How would I write the code to do this.
Microsoft AccessMicrosoft SQL ServerSQL
Last Comment
Jim Dettman (EE MVE)
8/22/2022 - Mon
Pawan Kumar
You can do like below
Pass the name of the table at runtime
Exec('' select columnname from ' + variabletablename + '')
Pass the name of the table at runtime
Exec('' select columnname from ' + variabletablename + '')