传统ASP文件和Sql Server Express的问题 [英] Problem with the Legacy ASP files and the Sql Server Express

查看:52
本文介绍了传统ASP文件和Sql Server Express的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我在sqlserver.newusers小组中发布了这个问题,但我没有得到

任何回复,所以我打算尝试它在这里的优秀人员:)。


我在我的办公室继承了一些传统的ASP代码。原始代码的后端

正在使用SQL Server 2000,我正在测试在Express

版本上使用它。


我遇到了以下问题。


其中一个页面使用存储过程创建一个新表格和

返回值新表ID。


代码用VBScript编写,简述如下:


set cmd = Server.CreateObject( " ADODB.Command")

cmd.ActiveConnection = dbConnection

cmd.CommandText =" NewCompany"

cmd.CommandType = adCmdStoredProc


cmd.Parameters(" @ varCompanyName")= Request.Form(" COMPANYNAME")





cmd.Parameters(" @ RETURNVALUE")= 0

设置rsID = cmdCom.Execute

设置rsID = rsID。 NextRecordset

ID = cmdCom.Parameters(" @ RETURNVALUE")


在SQL Server 2000上, e ID正确返回,但Express

不是。事实上,它并没有填满大桶。例如,如果我在执行前将

RETURNVALUE设置为-5,则

新值保持为-5。我可以看到表格是正确创建的

,具有正确的ID。这只是客户网站收到的返回值

浏览器从未设置。


所以我的问题是,我需要做些什么改变吗?快递'

存储过程?


我们非常感谢任何建议。这个问题非常重要,因为很多客户正在将他们的SQL服务器从2000年迁移到2005年。


TIA

Hi all,

I posted this question in the sqlserver.newusers group but I am not getting
any response there so I am going to try it on the fine folks here:).

I inherited some legacy ASP codes in my office. The original code''s backend
is using the SQL Server 2000 and I am testing to use it on the Express
edition.

And I run into the following problem.

One of the pages is using a stored procedure to create a new table and
return the value of the new table ID.

The codes are written in VBScript, briefly, it is as follows:

set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection= dbConnection
cmd.CommandText = "NewCompany"
cmd.CommandType = adCmdStoredProc

cmd.Parameters("@varCompanyName") = Request.Form("COMPANYNAME")
:
:
cmd.Parameters("@RETURNVALUE") = 0

Set rsID = cmdCom.Execute
Set rsID = rsID.NextRecordset
ID = cmdCom.Parameters("@RETURNVALUE")

On the SQL Server 2000, the ID is returned correctly, but the Express
doesn''t. In fact, it didn''t fill in the vat all. For example, If I set the
RETURNVALUE to -5 before the execute,
the new value remains -5. And I could see the table is created correctly
with the proper id. It is just the return value received at the client web
browser is never set.

So my question is, is there any change I need to make for the Express''s
stored procedure?

Any suggestion is highly appreciated. This problem is kind of important as a
lot of our customers are migrating their SQL servers from 2000 to the 2005.

TIA

推荐答案

更有可能的是,您必须将Express产品设置为接受非本地

连接并启用除共享内存之外的其他连接协议。

之后,检查连接字符串。


然后,检查存储过程并确保它使用RETURN @value,或

相似。否则返回值什么也不返回。


我可能会做更多的事情,但需要更深入地了解

的sproc代码。


-

Gregory A. Beamer

MVP; MCP:+ I,SE,SD,DBA
http://gregorybeamer.spaces。 live.com


******************************* **************

在盒子外面思考!

*************** ****************************** *

" Light" < a@a.com写了留言

新闻:ex ************** @ TK2MSFTNGP02.phx.gbl ...
More likely, you have to set the Express product to accept non-local
connections and enable some other connection protocol than shared memory.
After that, examine the connection string.

Then, check the stored procedure and make sure it is using RETURN @value, or
similar. Otherwise the return value is returning nothing.

Therer is probably more I could do, but would need a deeper dive into the
sproc code.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Light" <a@a.comwrote in message
news:ex**************@TK2MSFTNGP02.phx.gbl...

大家好,


我在sqlserver.newusers小组中发布了这个问题,但我不是

在那里得到任何回复所以我打算在优秀人群上试试

这里:)。


我在办公室里继承了一些遗留的ASP代码。原始代码'

后端

正在使用SQL Server 2000,我正在测试在Express

版本上使用它。


我遇到了以下问题。


其中一个页面使用存储过程来创建新表格

返回新表ID的值。


代码用VBScript编写,简述如下:


set cmd = Server.CreateObject(" ADODB.Command")

cmd.ActiveConnection = dbConnection

cmd.CommandText =" NewCompany"

cmd.CommandType = adCmdStoredProc

cmd.Parameters(" @ varCompanyName")= Request.Form(" COMPANYNAME")





cmd.Parameters(" @ RETURNVALUE")= 0


设置rsID = cmdCom.Execute

设置rsID = rsID.NextRecordset

ID = cmdCom.Parameters(" @ RETURNVALUE")


在SQL Server 20上00,ID正确返回,但Express

不行。事实上,它并没有填满大桶。例如,如果我在执行前将

RETURNVALUE设置为-5,则

新值保持为-5。我可以看到表格是正确创建的

,具有正确的ID。这只是客户网站收到的返回值

浏览器从未设置。


所以我的问题是,我需要做些什么改变吗?快递'

存储过程?


我们非常感谢任何建议。这个问题非常重要,因为很多客户正在将他们的SQL服务器从2000迁移到2005年的

.


TIA
Hi all,

I posted this question in the sqlserver.newusers group but I am not
getting any response there so I am going to try it on the fine folks
here:).

I inherited some legacy ASP codes in my office. The original code''s
backend
is using the SQL Server 2000 and I am testing to use it on the Express
edition.

And I run into the following problem.

One of the pages is using a stored procedure to create a new table and
return the value of the new table ID.

The codes are written in VBScript, briefly, it is as follows:

set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection= dbConnection
cmd.CommandText = "NewCompany"
cmd.CommandType = adCmdStoredProc

cmd.Parameters("@varCompanyName") = Request.Form("COMPANYNAME")
:
:
cmd.Parameters("@RETURNVALUE") = 0

Set rsID = cmdCom.Execute
Set rsID = rsID.NextRecordset
ID = cmdCom.Parameters("@RETURNVALUE")

On the SQL Server 2000, the ID is returned correctly, but the Express
doesn''t. In fact, it didn''t fill in the vat all. For example, If I set the
RETURNVALUE to -5 before the execute,
the new value remains -5. And I could see the table is created correctly
with the proper id. It is just the return value received at the client web
browser is never set.

So my question is, is there any change I need to make for the Express''s
stored procedure?

Any suggestion is highly appreciated. This problem is kind of important as
a lot of our customers are migrating their SQL servers from 2000 to the
2005.

TIA


您好Gregory,


感谢您的快速回复。


只是为了尝试,我打开了所有的协议(比如tcp / ip),我无法获得
找到非本地连接的配置。无论如何,它不起作用。


连接字符串很好,因为我可以连接到数据库和

创建新表。 />

是的,存储过程确实做了一个

返回@RETURNVALUE,或者SQL Server 2000版本也不能正常工作。

无论如何,我还看到昨天在这个新闻组中David Lozzi的另一篇文章(从SQLDataSource和DetailsView返回SCOPE_IDENTITY


实际上是同样的问题作为我的(除了他使用ASP.Net,所以我的

问题与遗留ASP无关),所以这个问题很常见?


谢谢再次..


" Cowboy(Gregory A. Beamer)" < No ************ @ comcast.netNoSpamMwrote

消息新闻:48 ****************** **************** @ microsof t.com ...
Hi Gregory,

Thanks for the prompt response.

Just for trying, I turned on all the protocols (like tcp/ip) and I couldn''t
find the configuration for non-local conenctions. Anyway, it doesn''t work.

The connection string is fine as I could make connection to the DB and
create the new table.

And yes, the stored procedure did do a
return @RETURNVALUE or the SQL Server 2000 version won''t work either.

Anyway, I also see another post by David Lozzi (Returning SCOPE_IDENTITY
from SQLDataSource and DetailsView) in this newsgroup yesterday , which
actually is the same problem as mine (except his is using ASP.Net, so my
problem is not related to legacy ASP), so this problem is pretty common?

Thanks again..

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:48**********************************@microsof t.com...

更有可能的是,你必须设置Express产品接受非本地

连接并启用除共享内存之外的其他连接协议。

之后,检查连接字符串。


然后,检查存储过程并确保它使用RETURN @value,

或类似。否则返回值什么也不返回。


我可能会做更多的事情,但需要更深入地了解

的sproc代码。


-

Gregory A. Beamer

MVP; MCP:+ I,SE,SD,DBA
http://gregorybeamer.spaces。 live.com


******************************* **************

在盒子外面思考!

*************** ****************************** *

" Light" < a@a.com写了留言

新闻:ex ************** @ TK2MSFTNGP02.phx.gbl ...
More likely, you have to set the Express product to accept non-local
connections and enable some other connection protocol than shared memory.
After that, examine the connection string.

Then, check the stored procedure and make sure it is using RETURN @value,
or similar. Otherwise the return value is returning nothing.

Therer is probably more I could do, but would need a deeper dive into the
sproc code.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Light" <a@a.comwrote in message
news:ex**************@TK2MSFTNGP02.phx.gbl...

>大家好,

我在sqlserver.newusers组中发布了这个问题,但我不是在那里得到任何回复所以我要去尝试它在优秀的人们身上
这里:)。

我在办公室里继承了一些遗留的ASP代码。原始代码的后端
正在使用SQL Server 2000,我正在测试在Express
版本上使用它。

我遇到了以下问题。

其中一个页面使用存储过程创建一个新表,并返回新表ID的值。

代码是简而言之,用VBScript编写,如下:

set cmd = Server.CreateObject(" ADODB.Command")
cmd.ActiveConnection = dbConnection
cmd.CommandText = NewCompany
cmd.CommandType = adCmdStoredProc

cmd.Parameters(" @ varCompanyName")= Request.Form(" COMPANYNAME")


cmd.Parameters(" @ RETURNVALUE")= 0
设置rsID = cmdCom.Execute
设置rsID = rsID.NextRecordset
ID = cmdCom.Parameters (@ RETURNVALUE)

在SQL Server 2000上,ID正确返回,但Express
不是。事实上,它并没有填满大桶。例如,如果我在执行前将
RETURNVALUE设置为-5,则新值保持为-5。我可以看到表格是正确创建的
具有正确的ID。这只是客户收到的返回值
web
浏览器从未设置过。

所以我的问题是,我需要为Express做出任何改变吗? s
存储过程?

任何建议都非常感谢。这个问题很重要
因为我们的很多客户都将他们的SQL服务器从2000迁移到2005年。

TIA
>Hi all,

I posted this question in the sqlserver.newusers group but I am not
getting any response there so I am going to try it on the fine folks
here:).

I inherited some legacy ASP codes in my office. The original code''s
backend
is using the SQL Server 2000 and I am testing to use it on the Express
edition.

And I run into the following problem.

One of the pages is using a stored procedure to create a new table and
return the value of the new table ID.

The codes are written in VBScript, briefly, it is as follows:

set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection= dbConnection
cmd.CommandText = "NewCompany"
cmd.CommandType = adCmdStoredProc

cmd.Parameters("@varCompanyName") = Request.Form("COMPANYNAME")
:
:
cmd.Parameters("@RETURNVALUE") = 0

Set rsID = cmdCom.Execute
Set rsID = rsID.NextRecordset
ID = cmdCom.Parameters("@RETURNVALUE")

On the SQL Server 2000, the ID is returned correctly, but the Express
doesn''t. In fact, it didn''t fill in the vat all. For example, If I set
the
RETURNVALUE to -5 before the execute,
the new value remains -5. And I could see the table is created correctly
with the proper id. It is just the return value received at the client
web
browser is never set.

So my question is, is there any change I need to make for the Express''s
stored procedure?

Any suggestion is highly appreciated. This problem is kind of important
as a lot of our customers are migrating their SQL servers from 2000 to
the 2005.

TIA



当你使用基于com的adodb库时,它不是基于asp.net的。你在尝试访问返回

参数值之前,只需要读取一个结果集。检查你的2005 sp'只返回一个,尽管

更好的方法是在

访问参数值之前实际读取所有结果(NextResult)。


你应该切换到ado.net,因为你当前的代码是一堆内存

泄漏(你没有发布com对象)。

- bruce(sqlwork.com)


Light写道:
as you are using the com based adodb library, its not asp.net based. you
are only reading one result set before trying to access the return
parameter values. check that your 2005 sp''s only return one, though a
better approach is to actually read all result (NextResult) sets before
accessing parameter values.

you should switch to ado.net, as you current code a bunch of memory
leaks (you are not releasing com objects).
-- bruce (sqlwork.com)

Light wrote:

嗨Gregory,

感谢您的快速回复。


只是为了尝试,我打开了所有的协议(比如tcp / ip),我就不能了。 b $ b找到非本地连接的配置。无论如何,它不起作用。


连接字符串很好,因为我可以连接到数据库和

创建新表。 />

是的,存储过程确实做了一个

返回@RETURNVALUE,或者SQL Server 2000版本也不能正常工作。

无论如何,我还看到昨天在这个新闻组中David Lozzi的另一篇文章(从SQLDataSource和DetailsView返回SCOPE_IDENTITY


实际上是同样的问题作为我的(除了他使用ASP.Net,所以我的

问题与遗留ASP无关),所以这个问题很常见?


谢谢再次..


" Cowboy(Gregory A. Beamer)" < No ************ @ comcast.netNoSpamMwrote

消息新闻:48 ****************** **************** @ microsof t.com ...
Hi Gregory,

Thanks for the prompt response.

Just for trying, I turned on all the protocols (like tcp/ip) and I couldn''t
find the configuration for non-local conenctions. Anyway, it doesn''t work.

The connection string is fine as I could make connection to the DB and
create the new table.

And yes, the stored procedure did do a
return @RETURNVALUE or the SQL Server 2000 version won''t work either.

Anyway, I also see another post by David Lozzi (Returning SCOPE_IDENTITY
from SQLDataSource and DetailsView) in this newsgroup yesterday , which
actually is the same problem as mine (except his is using ASP.Net, so my
problem is not related to legacy ASP), so this problem is pretty common?

Thanks again..

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:48**********************************@microsof t.com...

>更有可能的是,你必须设置Express产品接受非本地连接并启用除共享内存之外的其他连接协议。
之后,检查连接字符串。

然后,检查存储过程并制作确定它使用RETURN @value,
或类似的。否则返回值什么也不返回。

我可能会做更多的事情,但是需要深入研究一下
的sproc代码。

- < Gregory A. Beamer
MVP; MCP:+ I,SE,SD,DBA
http://gregorybeamer.spaces。 live.com

*********************************** **********
在盒子外面思考!
*************************** ******************
光 < a@a.com写了留言
新闻:ex ************** @ TK2MSFTNGP02.phx.gbl ...
>More likely, you have to set the Express product to accept non-local
connections and enable some other connection protocol than shared memory.
After that, examine the connection string.

Then, check the stored procedure and make sure it is using RETURN @value,
or similar. Otherwise the return value is returning nothing.

Therer is probably more I could do, but would need a deeper dive into the
sproc code.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
"Light" <a@a.comwrote in message
news:ex**************@TK2MSFTNGP02.phx.gbl...

>>大家好,

我在sqlserver.newusers小组中发布了这个问题,但我不是在那里得到任何回复,所以我打算尝试一下优秀人员
这里:)。

我在办公室继承了一些遗留的ASP代码。原始代码的后端
正在使用SQL Server 2000,我正在测试在Express
版本上使用它。

我遇到了以下问题。

其中一个页面使用存储过程创建一个新表,并返回新表ID的值。

代码是简而言之,用VBScript编写,如下:

set cmd = Server.CreateObject(" ADODB.Command")
cmd.ActiveConnection = dbConnection
cmd.CommandText = NewCompany
cmd.CommandType = adCmdStoredProc

cmd.Parameters(" @ varCompanyName")= Request.Form(" COMPANYNAME")


cmd.Parameters(" @ RETURNVALUE")= 0
设置rsID = cmdCom.Execute
设置rsID = rsID.NextRecordset
ID = cmdCom.Parameters (@ RETURNVALUE)

在SQL Server 2000上,ID正确返回,但Express
不是。事实上,它并没有填满大桶。例如,如果我在执行前将
RETURNVALUE设置为-5,则新值保持为-5。我可以看到表格是正确创建的
具有正确的ID。这只是客户收到的返回值
web
浏览器从未设置过。

所以我的问题是,我需要为Express做出任何改变吗? s
存储过程?

任何建议都非常感谢。这个问题很重要
因为我们的很多客户都将他们的SQL服务器从2000迁移到2005年。

TIA
>>Hi all,

I posted this question in the sqlserver.newusers group but I am not
getting any response there so I am going to try it on the fine folks
here:).

I inherited some legacy ASP codes in my office. The original code''s
backend
is using the SQL Server 2000 and I am testing to use it on the Express
edition.

And I run into the following problem.

One of the pages is using a stored procedure to create a new table and
return the value of the new table ID.

The codes are written in VBScript, briefly, it is as follows:

set cmd = Server.CreateObject("ADODB.Command")
cmd.ActiveConnection= dbConnection
cmd.CommandText = "NewCompany"
cmd.CommandType = adCmdStoredProc

cmd.Parameters("@varCompanyName") = Request.Form("COMPANYNAME")
:
:
cmd.Parameters("@RETURNVALUE") = 0

Set rsID = cmdCom.Execute
Set rsID = rsID.NextRecordset
ID = cmdCom.Parameters("@RETURNVALUE")

On the SQL Server 2000, the ID is returned correctly, but the Express
doesn''t. In fact, it didn''t fill in the vat all. For example, If I set
the
RETURNVALUE to -5 before the execute,
the new value remains -5. And I could see the table is created correctly
with the proper id. It is just the return value received at the client
web
browser is never set.

So my question is, is there any change I need to make for the Express''s
stored procedure?

Any suggestion is highly appreciated. This problem is kind of important
as a lot of our customers are migrating their SQL servers from 2000 to
the 2005.

TIA



这篇关于传统ASP文件和Sql Server Express的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆