Node.js - problema de conexion con sqlserver

 
Vista:

problema de conexion con sqlserver

Publicado por hector sore (1 intervención) el 03/09/2020 17:19:27
tengo config;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const config = {
 
        server: "SV-VPROD",
        database: "BD_ABASTECIMIENTO",
        user: "sa",
        password:"hospital007*",
        port: 1433,
        options: {
            encrypt: false
        }
 
 
}
 
module.exports= config;



operacion

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
var config  = require('./dbconfig');
const sql = require('mssql');
 
 
 
async function getNet(){
 
 
    try{
        let pool = sql.Connection(config
    );
        let net =  await pool.request().query("select * from TB_MATERIALES");
        return  net.recordsets;
    }
    catch(error){
        console.log(error);
    };
 
}
module.exports = {
    getNet :  getNet
}



api

1
2
3
4
5
6
7
var Db = require('./dboperations');
var net = require('./net_cenabast');
const dboperations = require('./dboperations');
 
dboperations.getNet().then(result=>{
    console.log(result);
})




NO ME LOGRA CONECTAR HICE LA CONFIGURACION DEL SERVIDOR PERO NO LO HACER LA CONEXION VEO LOS DATOS CONEXION Y CONSIDER Y POR EL NOMBRE USUARIO HAGO PING Y LLEGO PERO NO LOGRO
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder