Showing posts with label executing. Show all posts
Showing posts with label executing. Show all posts

Thursday, March 22, 2012

Access ADP,Server 2000, inconsistent behavior with output paramete

I am getting inconsistent responses from SQL Server 2000 and do not know why
.
I populate the controls on an unbound form by executing a command object tha
t
calls a sproc that returns a recordset.
On SQL Server 2000 the srpoc returns the recordset used to fill the form's
controls plus an output parameter indicating a record was received. The
output parameter is the value of @.@.ROWCOUNT. If the value of the output
parameter = 0, the user gets an appropriate message concerning the failure t
o
retrieve the data.
The server on my desktop returns both the recordset for populating the form
and the value of @.@.ROWCOUNT from the database. No problem.
However, when I connect to an identical dataase on a server in Chicago using
a VPN, all I get back is the recordset. The value of the output parameter is
always zero, telling me no record was selected.
However, the record was selected as the data populates the form.
I can easily branch to the needed message using "If rst.BOF and rst.EOF
then..." but I'd like to know why the output parameter does not get returned
or is always zero when I use the VPN to connect to the database.
If I use a command object to execute a sproc that does not return a
recordset, I do get back any desired output parameters. This inconsistent
behavior only appears when the executed command object returns a recordset.
Is there a setting on the Chicago server causing the problem?
malcolmHow are you sure that these two databases are really identical?
One possibility would be that the server in Chicago has a different order
for fields inside a table. This could cause some trouble with ADP is you are
using things like Select * instead of Select field1, field2, ... .
When you change the connection, the Tables and the Views/SP/Functions
windows should be refreshed but we never know what may have happened. One
way to be sure would be to use the Refresh command for *BOTH* the Tables and
the Views/SP/Functions windows and/or to recompile the ADP file.
Another possibility would be a permission problem or a logon account that is
not mapped to the same role.
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"malcolm" <ramartower@.access312.com> wrote in message
news:00FCB54F-AEA4-43EB-A712-3B6FC3B68DA5@.microsoft.com...
>I am getting inconsistent responses from SQL Server 2000 and do not know
>why.
> I populate the controls on an unbound form by executing a command object
> that
> calls a sproc that returns a recordset.
> On SQL Server 2000 the srpoc returns the recordset used to fill the form's
> controls plus an output parameter indicating a record was received. The
> output parameter is the value of @.@.ROWCOUNT. If the value of the output
> parameter = 0, the user gets an appropriate message concerning the failure
> to
> retrieve the data.
> The server on my desktop returns both the recordset for populating the
> form
> and the value of @.@.ROWCOUNT from the database. No problem.
> However, when I connect to an identical dataase on a server in Chicago
> using
> a VPN, all I get back is the recordset. The value of the output parameter
> is
> always zero, telling me no record was selected.
> However, the record was selected as the data populates the form.
> I can easily branch to the needed message using "If rst.BOF and rst.EOF
> then..." but I'd like to know why the output parameter does not get
> returned
> or is always zero when I use the VPN to connect to the database.
> If I use a command object to execute a sproc that does not return a
> recordset, I do get back any desired output parameters. This inconsistent
> behavior only appears when the executed command object returns a
> recordset.
> Is there a setting on the Chicago server causing the problem?
> --
> malcolm

Thursday, March 8, 2012

Absurdal affair in trigger file

Hi!


I found a bug in my trigger and i don't know why it is error.

See small report:

After executing following code's fragment in my trigger:

print '************** koszt sadowe *****************' + str(@.orzecz_koszty_sadowe)
print '************** koszt mks *****************' + str(@.orzecz_mks_przyznane)
print '************** koszt korespondencji *****************' + str(@.orzecz_zasadzona_zaliczka_na_koresp)

-- Potrzebne do wstawienia pozycji 'Koszty sadowe'
IF @.orzecz_koszty_sadowe IS NULL
SET @.orzecz_koszty_sadowe = 0
IF @.orzecz_mks_przyznane IS NULL
SET @.orzecz_mks_przyznane = 0

IF @.orzecz_oplaty_pozostale IS NULL
SET @.orzecz_oplaty_pozostale = 0

IF @.orzecz_zasadzona_zaliczka_na_koresp IS NULL
SET @.orzecz_zasadzona_zaliczka_na_koresp = 0

-- Koniec sprawdzanie czy sa NULL


print '************** koszt sadowe *****************' + str(@.orzecz_koszty_sadowe)
print '************** koszt mks *****************' + str(@.orzecz_mks_przyznane)
print '************** koszt korespondencji *****************' + str(@.orzecz_zasadzona_zaliczka_na_koresp)

we have on consolle following result:

************** koszt sadowe ***************** 145
************** koszt mks ***************** 123
************** koszt korespondencji ***************** 43
************** koszt sadowe ***************** 0
************** koszt mks ***************** 123
************** koszt korespondencji ***************** 43


So, variable @.orzecz_koszty_sadowe was set to 0.
Previously it was 145, so why in the if statement it values to NULL?

After small change, code looks like this:

print '************** koszt sadowe *****************' + str(@.orzecz_koszty_sadowe)
print '************** koszt mks *****************' + str(@.orzecz_mks_przyznane)
print '************** koszt korespondencji *****************' + str(@.orzecz_zasadzona_zaliczka_na_koresp)

-- Potrzebne do wstawienia pozycji 'Koszty sadowe'
IF @.orzecz_koszty_sadowe IS NULL
SET @.orzecz_koszty_sadowe = 0
IF @.orzecz_mks_przyznane IS NULL
SET @.orzecz_mks_przyznane = 0

IF @.orzecz_oplaty_pozostale IS NULL
SET @.orzecz_oplaty_pozostale = 0

IF @.orzecz_zasadzona_zaliczka_na_koresp IS NULL
SET @.orzecz_zasadzona_zaliczka_na_koresp = 0

-- Koniec sprawdzanie czy sa NULL

print '************** koszt sadowe *****************' + str(@.orzecz_koszty_sadowe)
print '************** koszt mks *****************' + str(@.orzecz_mks_przyznane)
print '************** koszt korespondencji *****************' + str(@.orzecz_zasadzona_zaliczka_na_koresp)

and the result is following:

************** koszt sadowe ***************** 145
************** koszt mks ***************** 123
************** koszt korespondencji ***************** 43
************** koszt sadowe ***************** 145
************** koszt mks ***************** 123
************** koszt korespondencji ***************** 43



So the result is proper. Now I explain the difference between
above listings. Second listing arise from first by following
transformation:

1. Place the cursor after last character of comment preceding
first IF statement (ie. after ....pozycji 'Koszty sadowe')
2. Press Enter key
3. Press Delete key (the line comes back, to initial position)

And that's all :) There's no optical difference between two
listings. However first works bad, and the second works good.

Any idea? Explanation?
I used SQL Server 2000.
Best regards
Walter

Could you please post a script that demonstrates the problem?|||Probably there was a Unix-style newline in your SQL. The query editor displays CHR(13) without CHR(10) as a new line, but the SQL processor considers the text before and after CHR(13) to be part of the same line if there is no CHAR(10).

So the SQL processor interpreted
-- Potrzebne do wstawienia pozycji 'Koszty sadowe'
IF @.orzecz_koszty_sadowe IS NULL

to mean the same thing as

-- Potrzebne do wstawienia pozycji 'Koszty sadowe' IF @.orzecz_koszty_sadowe IS NULL

The typing you did changed the CHR(13) to a valid 2-character Windows newline marker.

Steve Kass
Drew University

Saturday, February 25, 2012

About SQLClient conters

Hi,
how can i get the following list of counters
in runtime when we executing the application with
database support and is there any command to find the
no.of connection are made in the database and no.of pooled
connection, no.of non pooled connection for the database.> Hi,
> how can i get the following list of counters
> in runtime when we executing the application with
> database support and is there any command to find the
> no.of connection are made in the database and no.of pooled
> connection, no.of non pooled connection for the database.
>
--
You should look at incorporating Windows Management Instrumentation (WMI)
into your application. This is a place to start:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
wmi_start_page.asp
Hope this helps,
--
Eric Cárdenas
Senior support professional
This posting is provided "AS IS" with no warranties, and confers no rights.