I am attempting to port an Access front_end/Access back_end application to Access front_end/Sql Server back_end.One small part of this application uploads a CSV file into a local table in the front end (using DoCmd.TransferText) and then proceeds to process it to merge the results into several back_end tables. This is the part I am trying to convert.Because I can do the complex merging operation as a stored procedure on SQL Server, I want to replace the local front end table with a linked table in Access, linked to a temporary table that I create on a connection (it has to be temporary as this is a multi-user environment and I don't want the users tripping over each other).I am linking all my permanent tables during start up using the AttachDSNLessTable routine that Microsoft have in their knowledge base for this sort of thing. This works great.However, I try to do the same with this temporary table after I have created it and it gives an error at the point where i try and append the new TableDef to the current tabledefs. The Err.Description is "Could not find installable ISAM." Microsoft's explanation of this error doesn't parse in the context of SQL Server.Here is the code in question (getStrConn is a function which returns the connection string - either cached, or derived from one of the already created tabledefs from the permanent tables) Set conn = New ADODB.Connection conn.Open getStrConn 'First create a temporary table on the server for the web site leads SQL = "CREATE TABLE [dbo].[#WebSiteLeads](" SQL = SQL & "[leadID] [int] IDENTITY(1,1) PRIMARY KEY CLUSTERED,[Title] [nvarchar](255) NULL,[Firstname] [nvarchar](50) NULL," SQL = SQL & "[Lastname] [nvarchar](50) NULL,[Sex] [nvarchar](10) NULL,[House] [nvarchar](50) NULL," SQL = SQL & "[Address1] [nvarchar](50) NULL,[Address2] [nvarchar](50) NULL,[Street] [nvarchar](50) NULL," SQL = SQL & "[Town_City] [nvarchar](50) NULL,[County] [nvarchar](50) NULL,[Postcode] [nvarchar](10) NULL," SQL = SQL & "[Email] [nvarchar](50) NULL,[Allow_email] [nvarchar](5) NULL,[Telephone] [nvarchar](20) NULL," SQL = SQL & "[Allow_tel] [nvarchar](5) NULL,[Cons_period] [nvarchar](20) NULL,[When] [nvarchar](20) NULL," SQL = SQL & "[Procedure] [nvarchar](20) NULL,[Consultation] [nvarchar](10) NULL,[Info_pack] [nvarchar](10) NULL," SQL = SQL & "[Source] [nvarchar](20) NULL,[Further_info] [nvarchar](255) NULL,[Callback] [nvarchar](50) NULL," SQL = SQL & "[Date_added] [nvarchar](30) NULL,[Date_added_dt] [datetime] NULL,[Callback_range] [tinyint] NULL," SQL = SQL & "[UcFname] [nvarchar](1) NULL,[UcLname] [nvarchar](50) NULL,[UcPcode] [nvarchar](10) NULL);" conn.Execute SQL For Each td In CurrentDb.TableDefs If td.name = "WebsiteLeads" Then CurrentDb.TableDefs.Delete "WebsiteLeads" End If Next 'link to the table just created Set td = CurrentDb.CreateTableDef("WebsiteLeads", dbAttachSavePWD, "[dbo].[#WebSiteLeads]", conn) CurrentDb.TableDefs.Append td importProgress = 0.1 'Update Progress bar DoEvents 'Import our text file DoCmd.TransferText acImportDelim, "Leads Import v2", "WebsiteLeads", txtFileName importProgress = 0.3 'Update Progress bar DoEvents 'We are going to do the rest as a stored procedure Set leadsRS = conn.Execute("EXEC dbo.LeadsImport;") importProgress = 0.9 'Update Progress bar DoEvents
The line that fails is "CurrentDb.TableDefs.Append td"I don't know what is wrong, or how to work around the problem. Any ideas?