Build an accde from accdb from command line? - powershell

Very similar to this question but I want to build an .accde from an .accdb file and try to integrate this into a DevOps pipeline. Is this possible maybe with maybe powershell or basic cmd commandS?

There seems to an undocument command that does this job (VBS)
Dim app
Dim strDBName
Dim strADEName
Set app = CreateObject("Access.Application")
strDBName = "Path_To_YourAccdb.accdb" 'e.g C:\Temp\Myapp.accdb
strADEName = "nameOf_The_Compiled.accde" 'e.g. C:\Temp\MyApp.accde
app.SysCmd 603, CStr(strDBName), CStr(strADEName)
Set app = Nothing
Just put the above is a vbscript and it will do the job just fine
Taken from here : https://codekabinett.com/rdumps.php?Lang=2&targetDoc=make-access-accde-vb-script

Related

Need assistance modifying a PowerCLI script

I was wondering if someone could please help with the following query. We are using the following script to enable Virtualization Based Security on a per VM level.
https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Turn-on-Virtualization-based-security-...
The script is running from within VMware Realize Automation / Orchestration in order to enable VBS as part of an specific workflow. The modified script for vRA/vRO is below.
The issue that I am having is that VBS can only be enabled when the VM is powered off, in some cases the workflow takes a little longer to run and by then the VM is running already which will make the task (script) to fail.
That being said, I was looking for some way to improve the script a little bit perhaps by adding something to power off the VM if it's running then execute the code in the script and then bring the VM back on. I feel that with something like this hopefully we will make sure that VBS is enabled when the VM is not running and once VBS is enabled it will turn on the VM to proceed. I have unsuccessfully tried to modify the code but I can't find a way to stop and start the VM successfully. Can someone please help?
Thank you
// Input: inputProperties from vRA
var enableVBS = inputProperties.customProperties.enableVBS
if (enableVBS == "true") {
var name = inputProperties.resourceNames[0]
var vms = VcPlugin.getAllVirtualMachines(null, name)
vm = vms[0]
var bootOpts = new VcVirtualMachineBootOptions()
var flags = new VcVirtualMachineFlagInfo()
var spec = new VcVirtualMachineConfigSpec()
bootOpts.efiSecureBootEnabled = true;
flags.vbsEnabled = true;
flags.vvtdEnabled = true;
spec.firmware = VcGuestOsDescriptorFirmwareType.efi;
spec.nestedHVEnabled = true;
spec.bootOptions = bootOpts;
spec.flags = flags;
vm.reconfigVM_Task(spec)
}

Terraform - Pass in Variable to "Source" Parameter

I'm using Terraform in a modular fashion in order to build out my infrastructure. I do this by having a configuration file that calls in the different modules. I want to pass an infrastructure variable which picks up what tagged version of the Github repository the application should be building out. Most importantly I'm trying to figure out how to make a concatenation of a string happen in the "source" variable of the configuration file.
module "athenaelb" {
source = "${concat("git::https://github.com/ORG/REPONAME.git?ref=",var.infra_version)}"
aws_access_key = "${var.aws_access_key}"
aws_secret_key = "${var.aws_secret_key}"
aws_region = "${var.aws_region}"
availability_zones = "${var.availability_zones}"
subnet_id = "${var.subnet_id}"
security_group = "${var.athenaelb_security_group}"
branch_name = "${var.branch_name}"
env = "${var.env}"
sns_topic = "${var.sns_topic}"
s3_bucket = "${var.elb_s3_bucket}"
athena_elb_sns_topic = "${var.athena_elb_sns_topic}"
infra_version = "${var.infra_version}"
}
I want it to compile and for the source to look like this (for example): git::https://github.com/ORG/REPONAME.git?ref=v1
Anyone have any thoughts on how to make this work?
Thanks,
Keren
This is not possible currently in Terraform itself.
The only way to achieve something like this is to use a separate script to interact with the git repository that Terraform clones into a subdirectory of the .terraform/modules directory and switch it to a different tag depending on which version you need. This is non-ideal since Terraform organizes these into directories based on a hash of the module path, but if you can identify the module in question it is safe to run git checkout within these repositories as long as you do not run terraform get again afterwards.
For more details and discussion on this issue, see issue #1439 in Terraform's issue tracker, where this feature was requested.
You could use envsubst or python jinja and use these wrapper scripts in your pipeline deploy script to actually build the scripts from .envsubst and .jinja files before your terraform plan/apply
https://github.com/uvoo/process-templates/tree/main/scripts
I wish terraform would support this but my guess is they never will so just add some simple functions/files into deploy scripts which is usually the best way to deploy.

How to a create a daily build folder using buildbot?

I want to save a copy of the nightly build, I figured putting each build into its own daily folder would be idea. However I cannot use the time from buildbot master.cfg because that it set when it is configured:
copy_files = [".\\release\\MyProgram.exe",
".\\install\\ChangeLog.js",
".\\translations.txt"]
server_dest_path_by_date = server_dest_path + "\\{0}".format(time.strftime("%Y-%m-%d"))
my_return.addStep(steps.MakeDirectory(dir=server_dest_path_by_date))
for file in copy_files:
my_return.addStep(ShellCommand(command=["copy", file, server_dest_path_by_date, "/y"]))
How would I get the current run date for use in the destination?
You need to set the date as a Property during runtime in your build config. Do something like this:
my_return.addStep(SetPropertyFromCommand(
property = 'dateRightNow',
command = ['python', '-c', '"import datetime;print datetime.datetime.now().strftime('%y-%m-%d')"']
))
For Python 3.6:
my_return.addStep(SetPropertyFromCommand(
property = 'dateRightNow',
command = ['python', '-c', 'import datetime;print(datetime.datetime.now().strftime("%y-%m-%d"))']
))
and then use the property like this:
my_return.addStep(steps.MakeDirectory(
dir=Interpolate('%(prop:dateRightNow)s')))
for file in copy_files:
my_return.addStep(ShellCommand(command=["copy", file, Interpolate('%(prop:dateRightNow)s'), "/y"]))
Make sure you import Interpolate and setPropertyFromCommand unto:
from buildbot.process.properties import Interpolate
from buildbot.steps.shell import SetPropertyFromCommand
The better way is to use a custom renderer for util.Interpolate(...)
#util.renderer
def cur_date(props):
return datetime.date.today().isoformat()
And later use it as custom keyword in build factory step
cppcheck_dst = '/home/upload/%(kw:cur_date)s/'
bF.addStep(steps.MakeDirectory(dir=util.Interpolate(cppcheck_dst, cur_date=cur_date)))
bF.addStep(steps.CopyDirectory(src='build/build.scan/static/',
dest=util.Interpolate(cppcheck_dst, cur_date=cur_date)))

Setting environment variable before running published application in citrix

I have a published application in my citrix server that flexes based on an environment variable which needs to be set in the server, after the session starts. Is there an easy way to do this?
The easiest way is to use .vbs script to set environment variable and then launch an application.
For example:
set ws = wscript.createobject("WScript.shell")
set systemEnv = wshShell.Environment("SYSTEM")
systemEnv("YourVariable") = "Your value"
ws.run("notepad.exe"), 0, true
Flags:
0 = Hidden
1 = displayed
True = Waits till command has completed before moving to next
False = Does not wait for command to complete before moving to next

Running JUnit-Tests that uses SWT-Display fails on Jenkins

I a have a few JUnit-Tests that makes use of the current Display to instantiate a few controls (TreeViewer for instance). Locally that works fine, no problem. When I commit these tests and jenkins runs the test I get a failed test for each test that makes use of Display.
My unit test uses the display variable in this manner:
#Test
public void testUtils() {
Display display = Display.getCurrent();
Shell shell = new Shell(display, SWT.NONE);
// org.eclipse.swt.widgets.Composite composite = new
// org.eclipse.swt.widgets.Composite(
// shell, SWT.NONE);
TreeViewer viewer = new TreeViewer(shell, SWT.MULTI | SWT.H_SCROLL
| SWT.V_SCROLL);
The error log jenkins generates is:
Time elapsed: 0.13 sec <<< ERROR!
org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]
at org.eclipse.swt.SWT.error(SWT.java:4109)
at org.eclipse.swt.widgets.Display.createDisplay(Display.java:902)
at org.eclipse.swt.widgets.Display.create(Display.java:890)
at org.eclipse.swt.graphics.Device.<init>(Device.java:154)
at org.eclipse.swt.widgets.Display.<init>(Display.java:499)
at org.eclipse.swt.widgets.Display.<init>(Display.java:490)
at org.eclipse.swt.widgets.Display.getDefault(Display.java:1693)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:260)
at org.eclipse.swt.widgets.Shell.<init>(Shell.java:253)
at
Is there any thing wrong with the way I am using Display in my tests? It works when executed on my local machine
The way you use Display looks OK to me. The error is likely related to the fact that your server is not running Gnome, hence SWT can't create a Display when you ask it to.
UPDATE
I just found a recent blog post, which explains what you need to do to run SWT UI tests on a headless server in more detail. Although the steps provided are meant for Hudson, they should be applicable to Jenkins as well.
It should all boil down to these two steps:
Check Run Xvnc during build (and don’t bother to check take screenshot, it doesn’t work)
Add an Execute shell build action before launching your tests with metacity –replace –sm-disable &
See the linked blog post for screenshots and more details.
You can try following two things,
execute command "xhost" or "xhost+" from your terminnal.
execute command "xhost" or "xhost+" from, jenkins terminal.