Topic: Start of stored procedure from Excel
People, help the code!
I need to launch stored procedure in SQL-server'e from with parameter input. That is, I enter into a cell 0,56, I launch a macro - it is fulfilled. And still somehow to receive as back coupling of the message of type, "it was not possible to write down value of density" or "the Parameter is written successfully down" is is provided by script .
I will make a reservation at once: from SQL procedure successfully works with output of diagnostic messages, the line of connection too is true. The resulted script advised, but not it, swears "Type mismatch".
Private Sub RecDens () Dim cn As New ADODB.Connection Dim cmd As ADODB.Connection Set cn = New ADODB.Connection cn. ConnectionString = "Provider=SQLOLEDB.1; Integrated Security=SSPI; Persist Security Info=True; Initial Catalog=PowerPlant; Data Source ="PROTON"' Ïàðàìåòðû ñòðîêè ïîäêëþ÷åíèÿ cn. Open Set cmd = New ADODB.Command cmd = "exec SPNetWriteGasDensity"AND"0.56" cn. Close End Sub
The moderator: we Learn to use tags of design of the code - FAQ