[AccessD] error in A2003

Heenan, Lambert Lambert.Heenan at AIG.com
Tue Mar 15 11:22:56 CST 2005


Pedro,

It would help us if you could show us what the error message is. The code as
such looks ok, but I would suggest you make a change...

It is never safe to assume that the command line processor is  called
'command.com'. Nor can you safely assume that it will be located in the Root
for drive C.  However Environ("COMSPEC") will always return the correct
location of the command line processor.
Therefore you should get used to doing this...

Dim strCommand as String
	strCommand = Environ("COMSPEC")
	call Shell(strCommand & " /c C:\label2.bat",vbMinimizedFocus)


Lambert



> -----Original Message-----
> From:	accessd-bounces at databaseadvisors.com
> [SMTP:accessd-bounces at databaseadvisors.com] On Behalf Of pedro at plex.nl
> Sent:	Tuesday, March 15, 2005 10:49 AM
> To:	AccessD at databaseadvisors.com
> Subject:	[AccessD] error in A2003
> 
> Hello Group,
> 
> the following code worked fine in A97. After conversion to A2003, the code
> itself doesn't give a compiling error, but the .bat that it is calling
> does give an error; the parameterisation isn't correct. When using the
> .bat file directly, it is working fine. 
> 
> Who can help.
> 
> Pedro Janssen
> 
> 
> 
> 
> Option Compare Database
> Option Explicit
> 
> Function label()
> 
> On Error GoTo label_Err
> 
>     Beep
> 
>     If MsgBox("Wilt U een testlabel printen?", vbYesNoCancel, "Testlabel")
> = vbYes Then
> 
>     Call Shell("c:\command.com /c c:\label2.bat", 2)
> 
> Else
> 
>     Exit Function
> 
> End If
> 
> label_Exit:
> 
> Exit Function
> 
> 
> label_Err:
> 
>     MsgBox Error$
> 
>     Resume label_Exit
> 
> 
> End Function
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com



More information about the AccessD mailing list