I'm using a vb6 dll, running on development works perfectly, when deployed (published in the same development machine) throws this error Object reference not set to an instance of an object
Like i said, it is the same machine, so i dont know what can be wrong. I already set defaultapppool to enable 32 bits apps, the platform in debug configuration is x86 also.
I tried to copy the dll file to the bin folder of the project published folder, and nothing happened.
The error does get fired when the function CalcularNecesidadPedido is called.
Dim calc As New WinBlindCalculoProd.WBCalculoProd
Try
If calc.CalcularNecesidadPedido(cnnpedidos, Distribuidor.SelectedItem.Value.ToString, argument(0)) Then
It doesnt even trigger the catch, just throw the error message from above.
Thanks in advance.
UPDATE
The problem seems to be on this insert of the vb6 dll:
strSQL = "Insert Into NecessidadePedido (Cliente,PedidoVenda,ItemVenda,Sequencia,DataExplosion," & _
" Uso,TipoComponente,Setor,Almoxarifado,TipoDocumento, " & _
" Componente,CorComponente,Manter_Estoque,Dimensoes,CompraEspecifica,TipoEstoque," & _
" Altura,Largura,Comprimento,OrdemMontagem,QtdNecessaria,Consumo) Values('" & Cliente & "','" & Pedido & "'," & intItem & "," & intSequencia & _
"," & PrepDate(Now(), CNN, True) & _
",'" & strUso & "','" & strTipoComponente & "','" & strSetor & "','" & strAlmoxarifado & "','" & strTipoDocumento & "','" & _
strComponente & "','" & strCor & "'," & Cbit(blnManter_Estoque) & "," & intDimensoes & "," & Cbit(blnCompraEspecifica) & ",'" & sTipoEstoque & _
"'," & sngAltura & "," & sngLargura & "," & sngComprimento & "," & Cbit(blnOrdemMontagem) & "," & sngQuantidade & "," & sngConsumo & ")"
CNN.Execute strSQL
I extract the strSQL string from development and deployment, this how they look like:
Dev: Insert Into NecessidadePedido (Cliente,PedidoVenda,ItemVenda,Sequencia,DataExplosion, Uso,TipoComponente,Setor,Almoxarifado,TipoDocumento, Componente,CorComponente,Manter_Estoque,Dimensoes,CompraEspecifica,TipoEstoque, Altura,Largura,Comprimento,OrdemMontagem,QtdNecessaria,Consumo)
Values('1','16784',1,11,{ts '2019-03-21 15:44:14'},'000','99','0001','01','PV','010216','000',1,1,0,'0',0,0,1250,1,1,1.25)
Dep: Insert Into NecessidadePedido (Cliente,PedidoVenda,ItemVenda,Sequencia,DataExplosion, Uso,TipoComponente,Setor,Almoxarifado,TipoDocumento, Componente,CorComponente,Manter_Estoque,Dimensoes,CompraEspecifica,TipoEstoque, Altura,Largura,Comprimento,OrdemMontagem,QtdNecessaria,Consumo)
Values('1','16784',1,11,{ts '2019-03-21 15:41:27'},'000','99','0001','01','PV','010216','000',1,1,0,'0',0,0,1250,1,1,1,25)
So the problem seems to be that consumo value, on deplyoment throws comma instead of dot for decimals. When i comment that line, it works on deployment.
I already tried to change the region settings of this pc, it didn't work. Any ideas? I don't want to modify that dll because it is used on other projects.