I am getting a "Wrong Data Type 2498 error" on the last line of this code. I have checked everything. What am I missing. I am just trying to link a SQL Server table into Access - didn't know that would be so hard. Some of the columns are empty in the SQL table if that matters.
Dim strTableName As String, strConnect As String
strConnect = "=ODBC;Driver={SQL Server};SERVER=sql1901;DATABASE=library;UID=SQLUser;PWD=SQLUser;"
strTableName = "dbo_resplan_view"
'Check to see if table exists. If it does, delete it.
If TableExists(CurrentDb, strTableName) Then
DoCmd.DeleteObject acTable, strTableName
End If
DoCmd.TransferDatabase acLink, "ODBC Database", strConnect, acTable, "dbo_resplan_view", strTableName,
Dim strTableName As String, strConnect As String
strConnect = "=ODBC;Driver={SQL Server};SERVER=sql1901;DATABASE=library;UID=SQLUser;PWD=SQLUser;"
strTableName = "dbo_resplan_view"
'Check to see if table exists. If it does, delete it.
If TableExists(CurrentDb, strTableName) Then
DoCmd.DeleteObject acTable, strTableName
End If
DoCmd.TransferDatabase acLink, "ODBC Database", strConnect, acTable, "dbo_resplan_view", strTableName,