Solved

Vb syntax Visual Studio 2010: Shell syntax

Posted on 2013-10-25
2
327 Views
Last Modified: 2013-10-25
I am trying to launch an Access Database but it does not work: -
  Dim Pathstr As String
            Pathstr = "C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"
            Dim Exestr As String
            Exestr = "C:\My Folder\My AccessDb.mdb"
            MsgBox(Pathstr & " " & Exestr)
            Shell(Pathstr & " " & Exestr)

Open in new window

I think it may be the spaces in the folder name, can anyone help?
0
Comment
Question by:HKFuey
2 Comments
 
LVL 24

Accepted Solution

by:
chaau earned 500 total points
ID: 39599936
You are right. It is the spaces. You need to surround paths with double quotes:
Dim Pathstr As String
            Pathstr = """C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE"""
            Dim Exestr As String
            Exestr = """C:\My Folder\My AccessDb.mdb"""
    

Open in new window

0
 

Author Closing Comment

by:HKFuey
ID: 39600032
Super, thanks very much!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now