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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transfering table to SQL Server

Status
Not open for further replies.

lars7

Technical User
Aug 16, 2005
817
GB
Hi Guy's,
I'm trying to send a table to my server with this SQL code but i get an error message "Expected:=" can anyone see where i have went wrong?

Function ODBCConnect()
Dim strSQl As String

strSQl = "SELECT * INTO [C:\Documents and Settings\Tom\Desktop].[tbltemp] " & _
"[ODBC;DSN=EmpDetSQL;UID=trusted_connection=YES;Table=dbo.tblTemp] " & _
"[ODBC;Driver=SQL Server;Server=172.31.112.32;Database=EmpDetSQL;UID=trusted_connection=YES;Table=dbo.tblTemp] " & _
"FROM tblTemp "

DoCmd.RunSQL strSQl

End Function

thanks in advance
 
Hi duane,

I'm at home trying this now but I got the same error when i removed UID=

strSQl = "SELECT * INTO [C:\Users\Tom\Desktop\EmpDetSQL].[tbltemp] " & _
"[ODBC;DSN=EmpDetSQL;trusted_connection=YES;Table=dbo.tblTemp] " & _
"[ODBC;Driver=SQL Server;Server=TOM-LT\SQLEXPRESS;APP=2007 Microsoft Office System;Database=EmpDetSQL;trusted_connection=YES;Table=dbo.tblTemp] " & _
"FROM tblTemp "


and I added my home server and operating system the the 3rd line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top