I have a file named: Exec MIS Report.csv
When I attempt to import this into Access 2003, I recieve an error , "Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'."
I renamed the file to: Executive MIS Report.csv
And now the file imports without a hitch. Is Exec a reserved word? Is Exec part of SQL?
Thank you!
-Kyle
6 4827 ADezii 8,834
Recognized Expert Expert @servantofone EXEC[UTE] is a Transact-SQL Reserved word which will execute a User Defined Function, a System Procedure, or a User-Defined Stored Procedure but I'm not sure if it has a bearing on your situation. Just for curiosity, have you tried Importing ExecMIS Report.csv without the Space?
Just tried that... and Access imports it correctly. It only occurrs when the file is named Exec with a space after it. I have never experienced anything like this before. You can import the CSV file into Excel with the first filename, but Access will not. Well, I guess it doesn't really matter... I'll just use a different filename. Thanks for the info!
NeoPa 32,556
Recognized Expert Moderator MVP
If you post in your actual code we can give a more precise answer without any guesswork.
I think you can assume that Exec is reserved though.
NeoPa,
I'm not using any code. I'm right-clicking in the database window, selecting import for the menu, and then choosing a file that has Exec within the filename. This causes Access to generate the error prior to the wizard popping up.
-Kyle
NeoPa 32,556
Recognized Expert Moderator MVP
Ah. I see.
I think this indicates a glitch in the Access code. Almost certainly related to a special case of "Exec ..." In the circumstances I can only suggest to avoid using it.
ADezii 8,834
Recognized Expert Expert @servantofone
It took me a little while, but I did come up with what may be a workable solution, the 'Base Code' of which I'll post for you. Basically, if the Filename contains 'Exec ' it is converted and Renamed to 'Exec_', the Import occurs without any problems, and the User is notified of this process. If the Filename does not contain 'Exec ', it is Imported normally. It is up to you as to whether or not it is a viable Option: - Public Function fImportCSVFile(strFileName As String)
-
Dim strNewName As String
-
-
If InStr(strFileName, "Exec ") > 0 Then 'does "Exec " appear in the File Name
-
strNewName = Replace(strFileName, "Exec ", "Exec_")
-
Name strFileName As strNewName 'Rename the File replqacing Exec with Exec_
-
DoCmd.TransferText acImportDelim, , "CSV Table", strNewName, False
-
MsgBox strFileName & " has been Renamed to " & strNewName & " in order to avoid " & _
-
"Import Errors", vbExclamation, "Change in File name"
-
Else
-
DoCmd.TransferText acImportDelim, , "CSV Table", strFileName, False
-
End If
-
End Function
To successfully Import a File with 'Exec ' contained within its Name: - Debug.Print fImportCSVFile("C:\Dezii\Exec Test.csv")
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard Hyett |
last post by:
I dug out a PHP version of Porters Algorithm from
:-http://www.tartarus.org/~martin/PorterStemmer/php.txt
Whenever I try and run it I'm getting the error
"Wrong parameter count for join() "
...
|
by: Fraser S |
last post by:
Hi, I am receiving an invalid mail Attachment error when trying to
send an attachment using System.Web.Mail. I have read other posts on
these errors and have since checked that the asp.net account...
|
by: Narine |
last post by:
Hi All,
I need to write one complicated update statement and I'm looking at
maybe finding a simpler way to do it.
I have 2 tables:
1.Photo Table
PhotoID FileName
1 111.jpg
|
by: Steve Drake |
last post by:
All,
I am trying to open a word document and get all the properties using .NET
(c#), if I create the wordapp, call the correct methods I get invalid cast
(see code examples), but if I create a...
|
by: Xam |
last post by:
Hello everybody
Do you know of a javascript routine that can warn if there are any
pre-defined invalid chars in the filename of an INPUT file box before it is
submitted with the submit button.
...
| |
by: Rubycon |
last post by:
Hi all,
can anybody tell me what he invalid parameter is in this code. When I
try to execute the mmioDescendParent I get a returncode 11, meaning
that an invalid parameter has been passed. I...
|
by: jason.neo |
last post by:
Hi all experts,
I am going nuts with this Invalid postback or callback argument thingy
with .Net 2.0
I am building a file attachment module which relays on a Datatable
stored in session (yeah...
|
by: eboyjr14 |
last post by:
I have this xml metacity thing, and it is giving off this error:
The file format is invalid.
<?xml version="1.0"?>
<metacity_theme>
<info>
<name>Royale</name>
<author>Devin...
|
by: mk |
last post by:
Hello,
I'm trying to learn how with statement can be used to avoid writing:
prepare()
try:
something_that_can_raise_SomeException()
except SomeException, err:
deal_with_SomeException...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |