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 4842 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,564
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,564
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() "
Can anyone guess what I am doing wrong, I haven't modified the class
so I assume its the way I'm calling it.
Richard
|
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 has
permissions to access the file and of course that it is there. I am
also running the program on the same machine that the file is stored.
I...
|
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 WORD PROJECT (from C#) and use the
Application (thisApplication) the word project creates, it works fine, but
this is far from a acceptable work...
|
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.
The process would be:
a) User clicks the INPUT File's Browse button to select the file from their
computer.
| |
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 just don't know which one
and therefor not how to improve my code.
Regards,
Rubycon
|
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 i know its unhealthy, but its the only "clean"
approach which I can think of to avoid tranfering temp files onto the
server) to maintain the list...
|
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 Samarin</author>
<copyright>Devin Samarin, 2007</copyright>
|
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
finally:
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |