[Freeswitch-users] Error loading ODBC

preetha preetha.ayyappan at gmail.com
Thu Sep 25 01:47:50 PDT 2008


Hi,
when i try to run a sample odbc code from freeswitch console like 
freeswitch at localhost> jsrun odbc.js

I found the following error:
API CALL [jsrun(odbc.js)] output:
OK

freeswitch at localhost> 2008-09-25 19:44:35 [ERR] mod_spidermonkey.c:3303
js_api_use() Error loading ODBC
2008-09-25 19:44:35 [ERR] odbc.js:11 mod_spidermonkey()  ReferenceError:
ODBC is not defined

code is:
use("ODBC");

var people = {};
people["authur"] = 30;
people["ford"] = 42;
people["trillian"] = 29;
people["zaphod"] = 304;
people["marvin"] = 1000001;


db = new ODBC("freeswitchdb", "freeswitch", "1234");
db.connect();

db.exec("create table demo (name varchar(255), age varchar(80));");

for (var i in people) {
    sql = "insert into demo values('" + i + "', " + people[i] + ");";
    console_log("debug", sql + "\n");
    db.exec(sql);
}

sql = "select * from demo;";
var line = "==============================\n";

console_log("notice", line);

db.exec(sql);

console_log("debug", "row count: " + db.numRows() + "\n");

while(db.nextRow()) {
    var row = db.getData();

    for (var i in row) {
        console_log("debug", "[" + i + "] = [" + row[i] + "]\n");
    }

    console_log("debug", "\n");
}



console_log("notice", line);

what should i specify in DSN.here i gave freeswitchdb which is a database
name.please assist me to solve this problem

Thanks

-- 
View this message in context: http://www.nabble.com/Error-loading-ODBC-tp19665456p19665456.html
Sent from the Freeswitch-users mailing list archive at Nabble.com.





More information about the FreeSWITCH-users mailing list