Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrong Data Type

Status
Not open for further replies.

lbunch

Programmer
Sep 5, 2006
120
US
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,
 
lcan4,
Looks like a simple typo, according to my help files:
Code:
DoCmd.TransferDatabase acLink, "ODBC Database[red][b]s[/b][/red]", strConnect, acTable, "dbo_resplan_view", strTableName, [b]True[/b]

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top