Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Semicolon in file name or file path

287 views
Skip to first unread message

Dave Patrick

unread,
Apr 4, 2009, 6:47:16 PM4/4/09
to
You really shouldn't have to since a semi-colon is not a universally legal
file name character. Better to name the file and directory structure to
something acceptable to all windows file systems.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


"Pony_Boys" wrote:
> How do handle the odbc connection string if the file name or path has a
> semicolon (;) in it.
>
> Example: C:\Test;1\fil;et.mdb
>
> Tried putting quotes around theDBQ="C:\Test;1\fil;et.mdb" but this did not
> work.

Pony_Boys

unread,
Apr 5, 2009, 12:38:01 AM4/5/09
to
I agree. However, Windows XP and Vista allows semi colons in file name and
path - so - there is no way to stop users from doing this.

I was hopping that ODBC had a solution to this issue.

Dave Patrick

unread,
Apr 5, 2009, 11:58:09 AM4/5/09
to
Are you building the string in code?

Dim myDBQ As String
myDBQ = "C:\Test" & ";" & "1\fil" & ";" & "et.mdb"
MsgBox myDBQ

Dave Patrick

unread,
Apr 5, 2009, 7:11:11 PM4/5/09
to
I'm waiting for an installation of office 2003 to complete on a test box to
try a couple of things and I'll let you know the result but in the end I
think you're going to have to educate the users not to use a semi-colon or
other illegal characters in file and or path naming.


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


"Pony_Boys" wrote:
> As part of my application, I ask the user to select a MDB file that they
> have
> created.
>
> The end user of my application has created a path with (;) in it.
>
> The connection string will not work with (;) in the path to the MDB file.

Dave Patrick

unread,
Apr 5, 2009, 8:18:51 PM4/5/09
to
This page indicates it may be possible though I wasn't successful with file
DSN, system DSN or data links.

http://msdn.microsoft.com/en-us/library/ms722656(VS.85).aspx

Pak-Ming Cheung - MSFT

unread,
Apr 9, 2009, 2:45:01 AM4/9/09
to
First, the link http://msdn.microsoft.com/en-us/library/ms722656(VS.85).aspx
is for OleDB, not for ODBC.

In your case, you can use a "brace character" to enclose the attribute
value. For example,
DBQ={C:\Test;1\fil;et.mdb}

Please be reminded that you have to use escape sequence if there is a
closing brace inside the filename, for example,
DBQ={C:\Test;1\fil}}et.mdb}

This represents the file:


C:\Test;1\fil}et.mdb

==================================================
For more information about connection string, you can refer to the page:
http://msdn.microsoft.com/en-us/library/ms715433(VS.85).aspx

For a normative reference, you can see:
[MS-ODBCSTR] http://msdn.microsoft.com/en-us/library/cc678149(SQL.90).aspx

Thanks,
Ming.
WDAC Team, Microsoft.

P.S. We recommend customers to use the forum to ask questions in the future,
where you can obtain a faster response (Forum is at:
http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/threads/)

Dave Patrick

unread,
Apr 9, 2009, 10:42:01 PM4/9/09
to
That's good info, I hope the OP sees this. Is there a document on this?


--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

Dave Patrick

unread,
Apr 12, 2009, 9:02:08 PM4/12/09
to
Ok, got it. Thanks.

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


"Pak-Ming Cheung - MSFT" wrote:

> Yes, as in my original reply, it is documented at MSDN:
> http://msdn.microsoft.com/en-us/library/ms715433(VS.85).aspx
>
> Also a normative reference is also available:

Pak-Ming Cheung - MSFT

unread,
Apr 12, 2009, 8:34:04 PM4/12/09
to
Yes, as in my original reply, it is documented at MSDN:
http://msdn.microsoft.com/en-us/library/ms715433(VS.85).aspx

Also a normative reference is also available:

[MS-ODBCSTR] http://msdn.microsoft.com/en-us/library/cc678149(SQL.90).aspx

Thanks,
Ming.
WDAC Team, Microsoft.

P.S. We recommend customers to use the forum to ask questions in the future,
where you can obtain a faster response (Forum is at:
http://social.msdn.microsoft.com/forums/en-US/sqldataaccess/threads/)

0 new messages