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

Problem with Docmd.TransferText

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I have the following code:


Private Sub cmdImportRanFile_Click()

strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.Ran_BillingDelete"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords

Dim dkg As Variant, str As String
dkg = Application.FileDialog(msoFileDialogFilePicker).Show
str = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)


DoCmd.TransferText acImportDelim, "RanBillingImportSpecificationA", "Ran_Billing", str

DoCmd.Hourglass True
strCnxn = set_connection()
Set cnxn = New ADODB.Connection
cnxn.Open strCnxn
strSQL_Execute = "dbo.Ran_BillingUpdate"
cnxn.Execute strSQL_Execute, , adExecuteNoRecords

DoCmd.Hourglass False
End Sub

The problem are is the DoCmd.TransferText statement. When the code is run I get the following error on this statement:

Runtime Error '3001': Invalid Argument.

This code runs perfectly in another database. I have inspected the import specification and compared it to the other database to ensure that they are the same and they are. I checked the references to make sure they are the same in both databases and they are. Can anyone shed some light on what I am possibly missing? Any help is appreciated. Thanks.

Dave
 


Hi,

I'd strongly suggest posting MS Access questions in one of the many MS Access forums like forum705.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top