Search code examples
sqlsql-server-expresssas-jmpjsl

JSL Connection to SQL Server Express Setup DSN


I am trying to automate JSL script and I need to update some records from SQL Server using JMP JSL Script. I have found below connection string, but I am not sure how to use this.

Open Database("DSN=ODBC Databasexxx;UID=xxxx;PWD=xxxxxxx;DBQ=mydatabasexxxx;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;",

Solution

  • Setup your ODBC Connection in ODBC Data Source Administrator. enter image description here

    Then you can just simply do this in your script.

    dbc = Create database connection("DSN=sqljmp;Server=;UID=;PWD=;Database=;");
    
    result = Execute SQL(dbc,"SELECT * FROM yourTable");