Importing a CSV file in my database

Biggles1
Biggles1 used Ask the Experts™
on
I use the following code to import a csv file into my database:

Private Sub cmdImport_Click()
On Error GoTo Err_cmdImport_Click:
Dim dbs As Database
Dim strSQL As String

DoCmd.SetWarnings False

Set dbs = CurrentDb

DoCmd.TransferText acExportDelim, "DelimWO-1", "tblImported", "C:\Users\AllPC\Downloads\Service-requests-08-22-18"

Exit Sub
Err_cmdImport_Click:
MsgBox Err & " " & Err.Description
End Sub

The table tblImported is already created (otherwise I get an error that it cant find it!)

When I run the program I get: 3027 Cannot Update.  Database Object is Read-Only.  I tested the table tblImported and it is NOT read-only

Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2014

Commented:
TransferText with the acExportDelim argument will EXPORT your data, not IMPORT it. Your expression would export data from a table named tblImported to a file at the address in that last argument (which is not properly formed - you should have a filename at the end).
Distinguished Expert 2017
Commented:
Try typing
DoCmd.TransferText

And the intellisense should help you compose the rest of the statement  Choose acImportDelim to get you on the right path.
Biggles1Founder/CEO

Author

Commented:
I realize my typo: It should have been acImportDelim
Biggles1Founder/CEO

Author

Commented:
Jo Winograd gave me some extensive answers.  Now I cant find them!  Please help.
Distinguished Expert 2017

Commented:
I'm not sure how we can help with this.  If you look in your profile, you should be able to see all the questions you asked.  Where the answers in some question you asked?  If not, try pinging Jo but ypu'll have to provide more detail since I'm sure she answers lots of questions.

New questions should be started in new threads.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial