Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a bath file from form load() 1

Status
Not open for further replies.

load3d

Programmer
Feb 27, 2008
117
US
I want to run the batch file if the version on my SQL server is different than the version on my local table. Here is my code: (It's not working)

If Dlookup("Version", "localversion") <> "Dlookup("Version, "SQLversion") then

call shell("C:\program files\Maintenance\Update.bat", VBNORMALFOCUS, 1)

else

end sub


When my form loads nothing happens. Help?
 
Code:
If Dlookup("Version", "localversion") <> [COLOR=red]"[/color]Dlookup("Version, "SQLversion") then 

call shell("C:\program files\Maintenance\Update.bat", VBNORMALFOCUS, 1) 

else 

end sub

take out extra quotes
 
Replace this:
If Dlookup("Version", "localversion") <> "Dlookup("Version, "SQLversion") then
With this:
If Dlookup("Version", "localversion") <> Dlookup("Version", "SQLversion") Then

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top