I really don't understand. I've got an error :

Erreur d'exécution Microsoft VBScript error '800a000d'

Type incompatible


My source field "numaffaire_pro" is bigint
My destination field "test" is bigint

This is my code :

Sub OpenDatabase(ByRef dbConn)
Set dbConn = Server.CreateObject("ADODB.Connection")
dbConn.ConnectionTimeout = 15
dbConn.CommandTimeout = 30
dbConn.Open "DSN=BIZCONNEX;UID=sa;PWD=%!ellAir;DATABASE=BIZMAN AG"

End Sub

The above connection code is in a tools.inc


The following code is in my asp page :

Dim Dern_num_aff_pro, res_Dern_num_aff_pro, Dern_num_aff, res_Dern_num_aff, res_final

OpenDatabase dbconn


Dern_num_aff_pro = "SELECT MAX(numaffaire_pro) FROM [BIZMANAG].[dbo].[FACTURES]"

set res_Dern_num_aff_pro = dbconn.Execute(Dern_num_aff_pro)



Dim ajout_affaire_chantier

ajout_affaire_chantier = "INSERT INTO BIZMANAG.dbo.CHANTIERS(shift, status, type, test) VALUES(' " & shift & " ', '" & Request.Form("status") & "' , '" & Request.Form("type") & "', '" & res_Dern_num_aff_pro & "' ) "

dbconn.Execute(ajout_affaire_chantier)



Please Help me