Error in Imporing text file to access table (1 Viewer)

aman

Registered User.
Local time
Today, 15:04
Joined
Oct 16, 2008
Messages
1,250
Hi Guys, I am getting runtime error '3625' at the docmd.transfertext line . The error message says "The text file specification 'Campaign Import spec' doesn't exist. You can't import,export or link using the specification. "
The same code for my other project works perfectly fine.
Code:
Public Function ImportCampaignData(sFileName As String, sSpecName As String, CampaignId As Integer, sFileType As Long) As Boolean

  '  On Error Resume Next

    ' Excel Objects
    Dim oExcelApp               As Excel.Application
    Dim oWorkSheet              As Worksheet
    Dim sExcelFileName          As String
    Dim rs                      As Recordset
    Dim oFS                     As FileSystemObject
    Dim sCustomersAdded         As String
    Dim sCustomersUdpated       As String
    Dim sLeadsAdded             As String
    Dim sErrorMessage           As String
    Dim db                      As Database
    
    ImportCampaignData = False
    
    Set db = CurrentDb
        'Remove the previous import data just in case it exists
        DoCmd.SetWarnings False
        Forms("frm_LM_ImportLeads").lblProgress.Caption = "Deleting Campaign Import.."
        Forms("frm_LM_ImportLeads").Repaint
        ClearDataFromTable "tbl_LM_Import_Mas_Campaign"
 
        Forms("frm_LM_ImportLeads").lblProgress.Caption = "Loading Campaign Import.."
        Forms("frm_LM_ImportLeads").Repaint
            ' Import the data
       ' Err.Clear
        
        DoCmd.TransferText acImportDelim, sSpecName, "tbl_LM_Import_Mas_Campaign", GFilePath & "\" & sFileName, False
 

sxschech

Registered User.
Local time
Today, 15:04
Joined
Mar 2, 2010
Messages
793
Did you check that the specification is in this project as you mentioned that the spec was in another project. You may need to import or recreate the spec if it is not in this project. To see, try to import manually and go to the advanced tab then click on Specs to see if it is listed.
 

aman

Registered User.
Local time
Today, 15:04
Joined
Oct 16, 2008
Messages
1,250
Sorry how can i import the specification ? Can you pls elaborate? The other project is created by my manager and I have taken the code from him but got stuck at this bit.

Thanks
 

sxschech

Registered User.
Local time
Today, 15:04
Joined
Mar 2, 2010
Messages
793
You would click on
External Data
Access
"Find the file" (browse)
Import tables queries...
Click OK
Select the table
On the right side you should see 4 buttons (OK, Cancel, Select All, Deselect All, Options >>)
Click on Options >>
You will see 3 boxes (Import, Import Tables, Import Queries)
Under Import, put a check box on the Import/Export Specs

Then Click OK

It may import other specs, so would recommend that you manually import the file one more time to bring up the specs and then you can see if the spec you need was imported as well as if there are others you don't need and delete or keep them if you may need down the road.
 

Attachments

  • ImportSpecs.PNG
    ImportSpecs.PNG
    38.7 KB · Views: 66

aman

Registered User.
Local time
Today, 15:04
Joined
Oct 16, 2008
Messages
1,250
I have added the specification as you suggested but still getting the same error message.

Any ideas|
?
 

aman

Registered User.
Local time
Today, 15:04
Joined
Oct 16, 2008
Messages
1,250
Sorry actually what happend is when i ticked checkbox 'Import/Export spec' and clicked OK. and when i went back again then it was deselected . Trid it couple of times but still the same error message :(
 

sxschech

Registered User.
Local time
Today, 15:04
Joined
Mar 2, 2010
Messages
793
Did you go through the import text wizard to see if the spec showed up? Perhaps there is a different name?
 

Attachments

  • AdvancedSpecs.jpg
    AdvancedSpecs.jpg
    105.2 KB · Views: 57

aman

Registered User.
Local time
Today, 15:04
Joined
Oct 16, 2008
Messages
1,250
Yes i did go through the import text wizard but no specifications were showing in that.
 

bastanu

AWF VIP
Local time
Today, 15:04
Joined
Apr 13, 2010
Messages
1,402
Compare your current project with your other project by looking at the two system tables that hold specification info (MSysIMEXColumns and MSysIMEXSpecs). You might even copy the records from one into the other.

Cheers,
Vlad
 

sxschech

Registered User.
Local time
Today, 15:04
Joined
Mar 2, 2010
Messages
793
Those tables are normally hidden, so you would either need to create a query in SQL view (after it is set up, you can switch to design view), or you would need to unhide system objects.

This will show you all in those tables if you copy and paste as a new query in sql view:

Code:
SELECT * FROM MSysIMEXColumns 

SELECT * FROM MSysIMEXSpecs
You would need to probably look them over and maybe join them to compile the data you are looking for.

Also would need to copy and view those queries in the original database (the one that has the Spec you are wanting to use) if you don't see it in your own database.
 
Last edited:

Users who are viewing this thread

Top Bottom