DIOWave
Visual Storage
Documents -- Tips
Home / Tips English | Japanese
* News
  • Started at Jan 12, 2005.

Sorry, currently Japanese Only

Sorry, currently Japanese Only

Step 1. Create empty .mdb file using "Data Sources (ODBC)" Tool.

(1) Launch "Data Sources (ODBC)" tool

Start >> Administrative Tools >> Data Sources (ODBC)

ODBC Data Source Administrator

(2) Create .mdb file

Then [Add] Button

Create New Data Source

Select [Microsoft Access Driver (*.mdb)] in the list ant then push [Finish]

ODBC Microsoft Access Setup

Push [Create...] button, then file open dialog appearers.
Select appropriate .mdb file path.

Simply push [Cancel] button to close the setup dialog. There is no need to specify [Data Source Name].

Step 2. Create Table into dicomstudy.mdb

(1) Create JavaScript file


 
        var dsn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=dicomstudy.mdb;Persist Security Info=False";

        var conn = new ActiveXObject("ADODB.Connection");
        conn.Open(dsn);

        var tobe_drop = false;
        var sch = conn.OpenSchema(20);
        for (; !sch.EOF; sch.MoveNext()) {
                if (sch('TABLE_NAME') == "DICOMSTUDY")
                        tobe_drop = true;
        }
        sch.Close();
        if (tobe_drop)
                conn.Execute("DROP TABLE DICOMSTUDY");

        var create_table_sql = "CREATE TABLE DICOMSTUDY ("
                + "SEQ_NO COUNTER, "
                + "SCP_TITLE VARCHAR(16), "
                + "SCU_TITLE VARCHAR(16), "
                + "VOLUME VARCHAR(16) NOT NULL, "
                + "PATH VARCHAR(255) NOT NULL, "
                + "REF_FILE VARCHAR(255), "
                + "STUDY_DT VARCHAR(16) NOT NULL, "
                + "PatientID VARCHAR(64), "
                + "PatientName VARCHAR(64), "
                + "StudyDate VARCHAR(8), "
                + "StudyTime VARCHAR(16), "
                + "StudyID VARCHAR(16), "
                + "Modality VARCHAR(8), "
                + "INSERT_DT VARCHAR(16), "
                + "ACCESS_DT VARCHAR(16), "
                + "CONSTRAINT dicomstudykey PRIMARY KEY (VOLUME, PATH) "
                + ")";
        conn.Execute(create_table_sql);

        var catalog = new ActiveXObject("ADOX.Catalog");
        catalog.ActiveConnection = conn;

        var table = catalog.Tables('DICOMSTUDY');
        var col_names = new Array("PatientID", "PatientName", "StudyDate", "StudyTime", "StudyID", "Modality");
        for (var e = new Enumerator(col_names); !e.atEnd(); e.moveNext()) {
                var col = table.Columns(e.item());
                col.Properties("Jet OLEDB:Allow Zero Length") = -1;             
        }

        conn.Close();

        conn = null;
        catalog = null;

(2) Run the script file