Launching an msdos application from Access 97 
Author Message
 Launching an msdos application from Access 97

I use to launch a msdos application from Visual Foxpro with no problem.
Recently I decided to switch to Access 97 with no great success.  Here is
the problem:

In Dos, the commmand line is :  lindo.exe<filein
Where Lindo is the application and filein is the data file that is submitted
to lindo.

In Visual Foxpro my code is:
nom_in = "c:\....    .txt"
nom_out = c:\....     .txt"
fic_in = fcreate (ALLT(nom_in))
fic_out=fcreate(ALLT(nom_out))
SET SAFETY OFF
(corpus of the program):
FPUTS /FWRITE ...model and contraints
FPUTS(fic_in, "divert "+nom_out)
FPUTS(fic_in, "go ")
FPUTS(fic_in, "LEAVE")
= fclose(fic_in)
= fclose(fic_out)
To launch lindo ;
set default to c:\lindoind
run lindo< &nom_in
set default to c:\vfp\yansan

In Access 97, I tried the following code but I did not find a way to pass
the data file filein to Lindo.  I can launch the application but I need to
find a way to pass the data file to lindo. Any idea how to do this?  It
would be great if you could help me on this one.  Thanks a lot for your
help.

Public Function myFile()
Dim RetVal
RetVal = Shell("c:\lindoind\lindo.exe", 1)
End Function



Wed, 19 Sep 2001 03:00:00 GMT  
 Launching an msdos application from Access 97
Try:

 Public Function myFile(filein as string)
 Dim RetVal
 RetVal = Shell("c:\lindoind\lindo.exe <" & filein, 1)
 End Function

In this way, you can simply pass the name of the file to your function.

Quote:

> I use to launch a msdos application from Visual Foxpro with no problem.
> Recently I decided to switch to Access 97 with no great success.  Here is
> the problem:

> In Dos, the commmand line is :  lindo.exe<filein
> Where Lindo is the application and filein is the data file that is submitted
> to lindo.

> In Visual Foxpro my code is:
> nom_in = "c:\....    .txt"
> nom_out = c:\....     .txt"
> fic_in = fcreate (ALLT(nom_in))
> fic_out=fcreate(ALLT(nom_out))
> SET SAFETY OFF
> (corpus of the program):
> FPUTS /FWRITE ...model and contraints
> FPUTS(fic_in, "divert "+nom_out)
> FPUTS(fic_in, "go ")
> FPUTS(fic_in, "LEAVE")
> = fclose(fic_in)
> = fclose(fic_out)
> To launch lindo ;
> set default to c:\lindoind
> run lindo< &nom_in
> set default to c:\vfp\yansan

> In Access 97, I tried the following code but I did not find a way to pass
> the data file filein to Lindo.  I can launch the application but I need to
> find a way to pass the data file to lindo. Any idea how to do this?  It
> would be great if you could help me on this one.  Thanks a lot for your
> help.

> Public Function myFile()
> Dim RetVal
> RetVal = Shell("c:\lindoind\lindo.exe", 1)
> End Function

--

Beer, Wine and Database Programming.  What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://webhome.idirect.com/~djsteele/



Wed, 19 Sep 2001 03:00:00 GMT  
 Launching an msdos application from Access 97

Quote:
> Try:
>  Public Function myFile(filein as string)
>  Dim RetVal
>  RetVal = Shell("c:\lindoind\lindo.exe <" & filein, 1)
>  End Function
> In this way, you can simply pass the name of the file to your function.

Nope. Only the command processor knows what to do with the pipe and
redirection symbols. Try:

RetVal = Shell("command.com /c c:\lindoind\lindo.exe < " & filein, 1)

--

WARNING: I cannot be held responsible for the above        They're   coming  to
because  my cats have  apparently  learned to type.        take me away, ha ha!



Fri, 21 Sep 2001 03:00:00 GMT  
 Launching an msdos application from Access 97
Thanks, Joe. That'll teach me to post before I've tested the _exact_
syntax I'm using! (As you probably guessed, I was too lazy to find
something that used redirection, so I simply tested with one that
accepted a file name as a command line argument)


Quote:


> > Try:

> >  Public Function myFile(filein as string)
> >  Dim RetVal
> >  RetVal = Shell("c:\lindoind\lindo.exe <" & filein, 1)
> >  End Function

> > In this way, you can simply pass the name of the file to your function.

> Nope. Only the command processor knows what to do with the pipe and
> redirection symbols. Try:

> RetVal = Shell("command.com /c c:\lindoind\lindo.exe < " & filein, 1)

> --

> WARNING: I cannot be held responsible for the above        They're   coming  to
> because  my cats have  apparently  learned to type.        take me away, ha ha!

--

Beer, Wine and Database Programming.  What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://webhome.idirect.com/~djsteele/



Fri, 21 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Launch access 97

2. Launching Access 97 from Visual Basic Form

3. Help, using an Access 97 DB without MS Access Application

4. Help, using an Access 97 DB without MS Access Application

5. Help, using an Access 97 DB without MS Access Application

6. Access 97: VBA-DAO-Access 97 synchronization problem?

7. Create a modular Access 97 Application

8. Access 97 - Application.Quit does not work if msgbox is displayed

9. installing Office 2000 kills Access 97 run-time applications

10. Application.International in Access 97?

11. Newbie question: access 97 ONLY from VB application

12. VB 6 Application with Access 97

 

 
Powered by phpBB® Forum Software