Scroll

Fast export to QES from command line

Fast export to QES from command line

Follow
Summary This article is a description of a standalone .exe that allows fast exporting data to .qes files
Applies to askiafield
Written for field managers; data processors
Keywords CmdQesExporter; fast; export; command ; cmd ; line ; QES ; data ; exporter ; CmdExporter; commandline

Here is all you need to know about the Fast export to QES from command line…

Download the latest version

What is it?

This tool enables you to use one of Supervisor's features from a command line : the "Export data into .QES file".

It is worth mentioning that if you use CCA 5.3.4 or below, using this tool will also significantly reduce the data exporting time (~10 times faster than 5.3.3 "built-in" CCA exports)

 

What are the minimum requirements?

To run this tool you will need to ensure “Access Runtime” is installed on your server.
Either 2007, 2010 or 2013, but it has to be 32bit (x86)

Access Runtime 2007:
http://www.microsoft.com/en-us/download/details.aspx?id=4438
Access Runtime 2010:
http://www.microsoft.com/en-us/download/details.aspx?id=10910
Access Runtime 2013:
http://www.microsoft.com/en-us/download/details.aspx?id=39358

If the driver is missing, running the script will result in the following error message : 

Error : Could not open target database (Error accessing database in SDBStructureAdo ::Open : [ADODB.Connection] Provider cannot be found. It may not be properly installed).

 

Where do I find it?

You can download the tool from here

Download the latest “CmdQesExporter.rar” file and extract the contents to a suitable directory on your server.
The zipped file includes an instructions file, where you will find all relevant information.

 

How do I use it ?

To launch an extraction to QES, please follow these steps ON YOUR SERVER:

  1. Open the "run" command dialog by pressing Winkey + R. (Winkey is the keyboard button with a windows icon on it - between "ctrl" and "alt")
  2. Type "cmd" then press enter
  3. Now that the windows command line interface is running, you need to go to the directory where the "CmdQesExporter.exe" is. To do that, type "cd" (without quotes) in the command line followed by the directory where the "CmdQesEporter.exe" is.
    For example: cd C:\users\matt\desktop\Qes Exporter
  4. You can now launch the executable "CmdQesExporter.exe" followed by its command line arguments.

Command line formatting

You can now launch the executable "CmdQesExporter.exe" followed by its command line arguments.
The program parameters are the following, no order is enforced:

/help prints the help about how to launch the program
/source required, followed by the path for the source Qes file containing the structure of the survey.
/format required, followed by "LEGACY" or "NEW" depending on the sql tables format to extract from
/connectstring required, followed by the connection string to connect to the sql database

ex: "Provider=sqloledb;Data Source=ASKIA-PC\SQLEXPRESS;Initial Catalog=Test_Extraction;User Id=askia;Password=askia;"

of course each value after each "=" should be replaced with the apropriate value except for the "Provider",
the "Data Source" value can be "(local)" if the sql server is on the same machine and there is only one installed.
The "Initial Catalog" is the name of the database containing the survey data.
/id required, followed by the ID of the survey to extract
/target required, followed by the path for the target Qes file to create.
/progress optional, should be followed by "CONSOLE" (default value) to debug easily
/pipe optional when the progress is "CONSOLE"
/interviewid optional, can be followed by the id of the interviews you want to export (separated by commas)
/interviewidfile optional, can be followed by a file containing the id of the interviews you want to export (one per line)
/completion optional, can be followed by "COMPLETE" or "INCOMPLETE" to export only the corresponding interviews
/minstartdate optional, Can be followed by a date with the format dd/mm/yyyy to export only interviews started ON OR AFTER that day - i.e. >=
/maxstartdate optional, Can be followed by a date with the format dd/mm/yyyy to export only interviews started BEFORE that day - i.e. <
/minenddate optional, Can be followed by a date with the format dd/mm/yyyy to export only interviews ended ON OR AFTER that day - i.e. >=
/maxenddate optional, Can be followed by a date with the format dd/mm/yyyy to export only interviews ended BEFORE that day - i.e. <
/seed optional, can be followed by the seeds of the interviews you want to export (separated by commas)
/seedfile optional, can be followed by a file containing the seeds of the interviews you want to export (one per line)
/endpause optional, can be followed by "UNPAUSE" wich makes the exporter not to pause at the end of the export

 

 

Examples 

Some examples of the final command to launch might look like :

CmdQesExporter.exe /source "c:\users\matt\desktop\test.qes" /format "LEGACY" /connectstring "Provider=sqloledb;Data Source=MATT-PC\SQLEXPRESS;Initial Catalog=CCA_SURVEYS;User Id=matt;Password=BlueSky;" /id "215" /target "c:\users\matt\desktop\test_out.qes" /progress "CONSOLE"
CmdQesExporter.exe /source "c:\users\matt\desktop\other.qes" /format "NEW" /connectstring "Provider=sqloledb;Data Source=(local);Initial Catalog=CCA_SURVEYS;User Id=name;Password=pass;" /id "666" /seed "12345,76543" /seedfile "c:\my_path\seeds.txt" /target "c:\data\news_extracted.qes" /progress "CONSOLE" /completion "COMPLETE" /minstartdate "24/06/2012" /maxstartdate "28/06/2012" /endpause "UNPAUSE"


Automation

You can also put the command in a batch file (.bat extenstion) and launch it

Have more questions? Submit a request

Comments