troubleshooting Question

DSN Less Connection to SQL table in Access

Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America asked on
Microsoft Access
5 Comments1 Solution584 ViewsLast Modified:
I am trying to connect to an SQL table in Access using DSNLess Connection string for Linked table.  Note multiple user will be access this database so setting ups a DSN connection for a linked table will not be sufficient.  What am I doing wrong:

Server name = SQL-NWSS-007\AUB1
Database name = FTVI_DBMS
SQL Table Name dbo.TA_AirplaneInfo

Public Function LinkODBCTable()

Dim db As Database, tdf As TableDef
Dim strConnect As String
strConnect = "ODBC;SERVER=MySQLServer;UID=sa;DRIVER=SQL" & _
"Server;DATABASE=SQL-NWSS-007\AUB1\FTVI_DBMS"
Set db = CurrentDb()
Set tdf = db.CreateTableDef(Name:="dbo_TA_AirplaneInfo", Attributes:=dbAttachSavePWD, SourceTableName:="dbo.TA_AirplaneInfo", Connect:=strConnect)
db.TableDefs.Append tdf

End Function

K
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros