If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Opening another Access 97 DB

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-11-03, 09:53
PostalPete PostalPete is offline
Registered User
 
Join Date: Sep 2003
Location: Leeds, West Yorkshire, UK
Posts: 12
Opening another Access 97 DB

Could anyone help me with the code for opening another access 97 database.
The problem i have is there are spaces in the path to the db and it doesn't like it.

any suggestions would be much appreciated.

cheers


Pete
Reply With Quote
  #2 (permalink)  
Old 12-11-03, 10:08
jmrSudbury jmrSudbury is offline
Registered User
 
Join Date: Oct 2003
Location: Canada
Posts: 573
Here is now I do this:

stPath = stDirA & "MSACCESS.EXE /wrkgrp " + Chr(34) + _
stDirS & "SYSTEM.MDW" + Chr(34) + " " + Chr(34)
stAppName = stPath + Locate + "\" + stAppName + ".mde" '+ Chr(34) ' + " /excl"

Call Shell(stAppName, 1)

note that stDirA and stDirS are either looked up from a table or gotten using an input box or open dialog active X control. The Chr(34) put in double quotes so you can handle spaces like c:\program files\...
Reply With Quote
  #3 (permalink)  
Old 12-11-03, 11:50
PostalPete PostalPete is offline
Registered User
 
Join Date: Sep 2003
Location: Leeds, West Yorkshire, UK
Posts: 12
cheers mate much appreciated.

will try the code and let you know if i'm a numpty or not...lol
Reply With Quote
  #4 (permalink)  
Old 12-11-03, 19:46
Norberto Norberto is offline
Registered User
 
Join Date: Aug 2003
Location: Argentina
Posts: 465
You can do this too:

Dim RetVal
RetVal = Shell("C:\Archivos de programa\Microsoft Office\Office\MSAccess.exe C:\GralRoca\Agenmde.mde /x Ingreso", 1)
__________________
Saludos
Norberto
Reply With Quote
  #5 (permalink)  
Old 12-12-03, 01:27
CyberLynx CyberLynx is offline
Stuck on my opinions...
 
Join Date: Nov 2003
Posts: 1,487
The Shell function in Access does not like the Joliet (long file Name) format. Convert to the Short file name format (I can give you a function that does this). Basicly, if your file is named: This is my file Name.mdb then convert it to this: Thisis~1.mdb. First six characters (with no spaces) then a Tilde (~), and the the number one (1). Convert your folders as well if neccessary.
Reply With Quote
  #6 (permalink)  
Old 12-12-03, 08:28
PostalPete PostalPete is offline
Registered User
 
Join Date: Sep 2003
Location: Leeds, West Yorkshire, UK
Posts: 12
cheers everyone, i used jmrSudbury approach and it worked perfectly. cheers for your recommendations though.

Pete
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On