PC Review


Reply
Thread Tools Rate Thread

access doesn't like directory names that have a "." followed by sp

 
 
=?Utf-8?B?bWFydHk=?=
Guest
Posts: n/a
 
      21st Feb 2006
If you try to move a table from one database to another using the following
SQL command it will fail with an "Invalid bracketing" error. The problem
appears to be that the directory name contains a period followed by a space
character. When you remove the period or the space it works.

SELECT Table1.* INTO Table1 IN 'C:\US. Air\db2.mdb' FROM Table1;

Is there some way I can get around this problem so that I don't have to
worry about what directory name the user chooses?

- marty


 
Reply With Quote
 
 
 
 
=?Utf-8?B?RGF2aWQ=?=
Guest
Posts: n/a
 
      21st Feb 2006
This is likely to be just the beginning of the problems that you could
experience in this scenario. Access REALLY dislikes directory names that have
have a period ANYWHERE is the path (other than the file extension).

Even if you are able to resolve this specific issue when exporting to
external tables, if you try to open the database file you specify below,
you'll probably run into the issue where the "security" feature of Access
refuses to open a database with a period in the path prior to the file
extension.

See the MSKB Article:
You receive an error message when you try to open an Access 2002 database
from a Web Server
http://support.microsoft.com/kb/810582/en-us

My recommendation would be to programmatically prevent the user from
exporting to a database with a period prior to the extension.

David

David


"marty" wrote:

> If you try to move a table from one database to another using the following
> SQL command it will fail with an "Invalid bracketing" error. The problem
> appears to be that the directory name contains a period followed by a space
> character. When you remove the period or the space it works.
>
> SELECT Table1.* INTO Table1 IN 'C:\US. Air\db2.mdb' FROM Table1;
>
> Is there some way I can get around this problem so that I don't have to
> worry about what directory name the user chooses?
>
> - marty
>
>

 
Reply With Quote
 
Guest
Posts: n/a
 
      21st Feb 2006
Use the Windows ShortName API to lookup the
8.3 equivalent name, and use that instead.

(david)

"marty" <(E-Mail Removed)> wrote in message
news9BE38E3-A81E-4D43-AA6E-(E-Mail Removed)...
> If you try to move a table from one database to another using the

following
> SQL command it will fail with an "Invalid bracketing" error. The problem
> appears to be that the directory name contains a period followed by a

space
> character. When you remove the period or the space it works.
>
> SELECT Table1.* INTO Table1 IN 'C:\US. Air\db2.mdb' FROM Table1;
>
> Is there some way I can get around this problem so that I don't have to
> worry about what directory name the user chooses?
>
> - marty
>
>



 
Reply With Quote
 
david epsom dot com dot au
Guest
Posts: n/a
 
      21st Feb 2006
Private Declare Function GetShortPathName Lib "kernel32" _
Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long


Function GetShortName(ByVal sLongFileName As String) As String
'2005/04/15 dlg from MS KB 891176
Dim lRetVal As Long, sShortPathName As String, iLen As Integer
'Set up a buffer area for the API function call return.
sShortPathName = Space(255)
iLen = Len(sShortPathName)

'Call the function.
lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen)
'Remove unwanted characters.
GetShortName = Left(sShortPathName, lRetVal)
End Function

(david)

<david@epsomdotcomdotau> wrote in message
news:(E-Mail Removed)...
> Use the Windows ShortName API to lookup the
> 8.3 equivalent name, and use that instead.
>
> (david)
>
> "marty" <(E-Mail Removed)> wrote in message
> news9BE38E3-A81E-4D43-AA6E-(E-Mail Removed)...
>> If you try to move a table from one database to another using the

> following
>> SQL command it will fail with an "Invalid bracketing" error. The problem
>> appears to be that the directory name contains a period followed by a

> space
>> character. When you remove the period or the space it works.
>>
>> SELECT Table1.* INTO Table1 IN 'C:\US. Air\db2.mdb' FROM Table1;
>>
>> Is there some way I can get around this problem so that I don't have to
>> worry about what directory name the user chooses?
>>
>> - marty
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 typing in "to" field doesn't bring up names in contac FrankSpokane Microsoft Outlook Discussion 1 27th Dec 2009 02:46 AM
Field Names: "LongName", "ShortName", "Code", "Description","Comments" PeteCresswell Microsoft Access 2 25th Feb 2009 11:41 PM
"Access denied" on the "Program Files" directory - Win XP Prof SP2 mblasich@yahoo.com Windows XP Security 2 16th Dec 2006 10:23 PM
when I create a new email, "Select Names" dialogue doesn't show co =?Utf-8?B?UmljaGFyZCBNaWxscw==?= Microsoft Outlook Contacts 3 23rd Mar 2006 12:54 AM
Retrieving Active Directory "Full Names" =?Utf-8?B?V2FyZA==?= Microsoft Excel Programming 5 24th Jun 2005 11:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:56 PM.