26

Re: Start of stored procedure from Excel

Make parameter @Density numerical

27

Re: Start of stored procedure from Excel

kovax wrote:

Shocker Pro, maybe, prompt, what is the matter?
Normally I enter number where as a separator the point serves - then  writes "Successfully". If to deliver a separator a comma and to try to launch  through QA  will swear, and the number does not register - is checked up. If as to make, using , it produces the message "Successfully" though  after all does not fulfill record! Even if to reboot a computer (to eliminate saving Recordset'), to open the book and at once to try to write down number with a "wrong" separator - all the same writes that is successful. Here it strains me!

Why you decided that " after all does not fulfill record"
If to you returned "Successfully"  fulfilled on "hurrah"
You do not confuse start  in QA and from other places. In QA a separator whole and a fractional part always a point. It falls at a stage of compilation of request.
In Eksele if you created parameasures of type number, there and number (on-possibility  will be transferred)

28

Re: Start of stored procedure from Excel

HandKot wrote:

In Eksele if you created parameasures of type number there and the number (on-possibility )

That's just the point, a jamb here will be transferred

cmd. Parameters. Append cmd. CreateParameter ("@Density",>>> adVarChar <<<, adParamInput, 5, TextBox1.Value)

29

Re: Start of stored procedure from Excel

HandKot;
Before to write here, I check always result that most, other participants not to tangle.
Still here time tried value from a comma from  to send - did not register, I it directly in the instrument (a gas meter, -761) look.
Shocker Pro;
QA "agree to work" only with varchar. With real, c float does not want in any way, most it is strange!

30

Re: Start of stored procedure from Excel

kovax wrote:

QA "agree to work" only with varchar. With real, c float does not want in any way, most it is strange!

nonsense tell
The decision I told - change varchar for number and ADO itself understands, as there it is correct to transfer number, irrespective of Windows localization

31

Re: Start of stored procedure from Excel

Or you mean, what in  to leave @Dencity as is, that is varchar, and adVarChar to replace with other type (numerical)?

32

Re: Start of stored procedure from Excel

kovax wrote:

in  to leave @Dencity as is

is not present, to change in both places, and in xp_SPNet_set_array too

33

Re: Start of stored procedure from Excel

Not, I will not get into that file, it is a type file *dll, fulfills a role of the driver of the counter for SQL. With it while all.
I puzzle now over another  which from storage of the counter would receive now this density, and in the long term - on sheet  (as back coupling).

34

Re: Start of stored procedure from Excel

kovax wrote:

Not, in that file I will not get

well at least on an input into the  it is necessary to deliver number, and by a call xp_SPNet_set_array to convert at line

35

Re: Start of stored procedure from Excel

Understood, I will try!

36

Re: Start of stored procedure from Excel

kovax wrote:

Understood, I will try!

It will seems to me to change it is useless, the problem to see in call  master. xp_SPNet_set_array inside  SPNetWriteGasDensity
Make a simple crutch, . the parameter @Density is used only by call  master. xp_SPNet_set_array simply hammer in a crutch add a line

-- The counter 7, the channel 1
>>> Set @Density = Replace (@Density, ', ', '. ') <<<
exec @rc = master. xp_SPNet_set_array @Handle, 7, 1, 125, 9, @Density
set @WriteResult = @WriteResult + @rc

37

Re: Start of stored procedure from Excel

HandKot, works!
Thanks!

38

Re: Start of stored procedure from Excel

Found in list  procedure for reading of density from a gas meter. Someone to me still wrote it, I do not know even, whether the worker - it is necessary to check up, launching it in  and specifying values of variables, including @SPNetHandle. And here with it a problem! What is such how to learn its value - concepts I have no!
The same variable is in  for the record which text I already resulted, but there it, probably, itself is calculated, and here it is necessary to specify its value at start attempt in QA.

CREATE PROCEDURE SPNetGetGasDensity
@SPNetHandle int;
@RequestID int;
@Device int;
@Channel int;
@Array int;
@ArrayIndex int;
@DateTime datetime
AS
declare @rc as int
-- The temporary table of results of requests to 
create table #GetGasDensityResultTMP (
Device int;
Channel int;
Array int;
ArrayIndex int;
Value varchar (32);
Unit varchar (32);
DateTime varchar (32)
)
insert into #GetGasDensityResultTMP exec @rc = master. xp_SPNet_get_array @SPNetHandle, 7, 1, 125, 9, 1
-- The request is successful?
if @rc = 0 and @@ rowcount! = 0 begin
-- Data numerical?
declare @Value as varchar (32)
select @Value = Value from #GetGasDensityResultTMP
if isnumeric (@Value) = 1 begin
declare @SaveValueResult as int
-- Location of result of request in archive c duplication avoidance
update SPNetArchive set Value = cast (Value as float), StoredInOracle = 0 where RequestID = @RequestID and [DateTime] = @DateTime
set @SaveValueResult = @@ rowcount
if @SaveValueResult = 0 begin
insert SPNetArchive select @RequestID as RequestID, @DateTime, cast (Value as float), Unit, 0 as StoredInOracle from #GetGasDensityResultTMP
set @SaveValueResult = @@ rowcount
end
-- Successful attempt ?
if @SaveValueResult! = 0 begin
-- Removal of request from queue
delete from SPNetRequestsQueue where RequestID = @RequestID and DateTime = @DateTime
set @rc = 0
end
else begin
set @rc = 1
end
end
else begin
set @rc = 1
end
end
-- Cleaning of result of request
delete #GetGasDensityResultTMP
return @rc
GO

39

Re: Start of stored procedure from Excel

kovax wrote:

the Same variable is in  for the record which text I already resulted

is not present

40

Re: Start of stored procedure from Excel

However, there is @Handle, well so it is returned from xp_SPNet_connect

kovax wrote:

exec @rc = master. xp_SPNet_connect @Port, @Baud, @Timeout, @ConnDevAddr, @Handle OUTPUT

41

Re: Start of stored procedure from Excel

Shocker Pro, and there are ideas, what it can be?
At me the unique version - SPNetHandle is number of a network, (instruments are united in a network), in this case 1. And each network incorporates to the CATFISH-PORT.
I do such request in QA

exec SPNetGetGasDensity 1, 226, 7, 1, 125, 9, "20180303"

Writes to the answer "1 row affected = 0" - type, all the line long empty.

42

Re: Start of stored procedure from Excel

Let's tell so, it is the conditional number of a certain object of connection which forms xp_SPNet_connect and through which there is an exchange with the counter. To invent it it is impossible - it is necessary to use xp_SPNet_connect for its obtaining