janiel14 / node-sybase-nu

MIT License
1 stars 0 forks source link

SyBase.DBPools.main.client.connect return error as client is null #1

Open Super169 opened 5 years ago

Super169 commented 5 years ago

I just try to use the npm-sybase-nu to connect the Sybase server.

I have modified the connection information to connect my server in the example, and it works fine using the SQL query (by changing the SQL to "SELECT * FROM sysobjects" or others) in test.js.

But when I try to test with models in app.js, it return error in the connection statement as client is null.

E:\node.js\node-sybase\app.js:5 SyBase.DBPools.main.client.connect((error) => { ^

TypeError: Cannot read property 'connect' of null at CRUD (E:\node.js\node-sybase\app.js:5:32) at Object. (E:\node.js\node-sybase\app.js:57:1) at Module._compile (internal/modules/cjs/loader.js:956:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10) at Module.load (internal/modules/cjs/loader.js:812:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10) at internal/main/run_main_module.js:17:11

I have defined the table t_wxuser according to the definition in wxuser.js, and also try to create a models for my own table, but both of them has error as client is null.

I try to debug the program, it was found that SyBase.DBPools.main is OK, but the client is always null.

May I know if I have missed some steps to initiate the client in SyBase.DBPools.main ? Thanks a lot!

Super169 commented 5 years ago

P.S. I have also tested with node-sybase, it can update the table in my server. So the table schema should be correct.