ACC: "Incorrect Syntax Near '-'" Using TransferDatabase ActionID: Q106244
|
Advanced: Requires expert coding, interoperability, and multiuser skills.
When you are running a TransferDatabase macro action to attach a SQL
Server table, the following error message may be generated:
Connection Failed. SQL State 37000. SQL Server Error 102. Incorrect Syntax Near '-'.
This error is generated because there is an error in the database name
argument, or connect string, of the TransferDatabase macro action.
The Microsoft Access Help system suggests that the connect string can be
copied from the table properties of the attached table. When you copy the
connect string into the database name argument, a string similar to the
following example is produced:
NOTE: In the following example, an underscore (_) is used as a line-
continuation character. Remove the underscore when re-creating this
example.
ODBC;DSN=MyServer;UID=User2;APP=Microsoft Access;WSID=User2; _
DATABASE=pubs-->-->dbo.authors
Transfer Type: ATTACH.
Database Type: <SQL DATABASE>.
Database Name: ODBC;DSN=MyServer;UID=User2;APP=Microsoft Access; _
WSID=User2;DATABASE=pubs
Object Type: TABLE
Source: DBO.AUTHORS
Destination: DBO_AUTHORS
Structure Only: NO
Additional query words: transfer
Keywords : kberrmsg kbusage OdbcOthr
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbinfo
Last Reviewed: March 27, 1999