将参数传递给查询 [英] Passing Parameters to a query

查看:72
本文介绍了将参数传递给查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将超过1024个字符写入

备忘录字段时,我遇到了一个问题。显然我正在使用的odbc连接不允许

文字大于1024个字符。这个Memo文件可以带来几乎无限的数据,因此解决方案似乎是使用参数。我的

问题是我从未听说过这个问题,需要尽快开始工作。

有没有人有一个简单的例子,说明参数如何使用ASP?


I am running into an issue when I try to write more than 1024 characters to
a memo field. Apparantly the odbc connection I am using does not permit
literals to be larger that 1024 characters. This Memo filed can take
virtually infinate data, so the solution seems to be use parameters. My
problem is I have never heard of this and need this to work ASAP. Does
anyone have a simple example of how Parameters work using ASP?


推荐答案

Johnd写道:
当我尝试在备忘录字段中写入超过1024个字符时,我遇到了一个问题。显然odbc连接我是


这是你的第一个问题。您应该使用本机Jet OLEDB

提供程序。有关示例,请参见 www.able-consulting.com/ado_conn.htm

使用不允许文字大于1024个字符。
这个Memo文件可以获取几乎无限的数据,所以解决方案似乎是使用参数。我的问题是我从来没有听说过这个
并且需要这个尽快工作。有没有人有一个简单的例子说明
参数如何使用ASP?
I am running into an issue when I try to write more than 1024
characters to a memo field. Apparantly the odbc connection I am
That''s your first problem. You should be using the native Jet OLEDB
provider. See www.able-consulting.com/ado_conn.htm for examples.
using does not permit literals to be larger that 1024 characters.
This Memo filed can take virtually infinate data, so the solution
seems to be use parameters. My problem is I have never heard of this
and need this to work ASAP. Does anyone have a simple example of how
Parameters work using ASP?



http://www.google .com / groups?hl = en& l ... phx.gbl& rnum = 6

HTH,

Bob Barrows


-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。我的From

标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。



http://www.google.com/groups?hl=en&l...phx.gbl&rnum=6

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don''t check it very often. You will get a
quicker response by posting to the newsgroup.


感谢鲍勃,但更多细节。


我正在使用Advantage服务器6.2

这里是我的代码:

//设置Conn = Server.CreateObject(" ADODB。连接")

// Conn.Open" DSN = LocalOP"

// strQuery ="插入NCRheadcomments(hdrcomid,headerid,comdate,

userid,comments,comtime)" & _

//" values(10084,10080,''"& FormatDateTime(Date(),VBshortDate)& _

//" '',''"& session(" CurrentUser")&"'',''"& CurrentComment&"'',''"&

time&"'')"

//设置objRS = Conn.Execute(strQuery)

// conn.close

我的问题是CurrentComment大于1024个字符。有没有一种方法

可以在不使用保存的查询的情况下使用它,因为我不相信这是我现在可用的



John,


news:uX ************** @ TK2MSFTNGP09.phx.gbl ...
Thanks Bob but heres a little more detail.

I am using Advantage server 6.2

here is my code:
// Set Conn = Server.CreateObject("ADODB.Connection")
// Conn.Open "DSN=LocalOP"
// strQuery = "insert into NCRheadcomments (hdrcomid, headerid, comdate,
userid, comments, comtime)" &_
// "values(10084,10080, ''" & FormatDateTime( Date(), VBshortDate ) &_
// "'', ''" & session("CurrentUser") & "'', ''" & CurrentComment & "'', ''" &
time & "'')"
// Set objRS = Conn.Execute(strQuery)
// conn.close
My problem is CurrentComment is larger than 1024 characters. Is there a way
to get this to work without using a saved query as I do not believe that is
available to my at this time.

John,

"Bob Barrows" <re******@NOyahoo.SPAMcom> wrote in message
news:uX**************@TK2MSFTNGP09.phx.gbl...
Johnd写道:
当我尝试在备忘录字段中写入超过1024个字符时,我遇到了一个问题。显然我的odbc联系
这是你的第一个问题。您应该使用本机Jet OLEDB
提供程序。有关示例,请参见 www.able-consulting.com/ado_conn.htm
I am running into an issue when I try to write more than 1024
characters to a memo field. Apparantly the odbc connection I am
That''s your first problem. You should be using the native Jet OLEDB
provider. See www.able-consulting.com/ado_conn.htm for examples.
使用不允许文字大于1024个字符。
这个Memo文件可以采取几乎无限的数据,所以解决方案似乎是使用参数。我的问题是我从来没有听说过这个
并且需要这个尽快工作。有没有人有一个简单的例子说明
参数如何使用ASP?
using does not permit literals to be larger that 1024 characters.
This Memo filed can take virtually infinate data, so the solution
seems to be use parameters. My problem is I have never heard of this
and need this to work ASAP. Does anyone have a simple example of how
Parameters work using ASP?



http:/ /www.google.com/groups?hl=zh-CN&l...phx.gbl&rnum=6
HTH,
Bob Barrows

-
Microsoft MVP - ASP / ASP.NET
请回复新闻组。我的From
标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。您将通过发布到新闻组获得更快的回复。


http://www.google.com/groups?hl=en&l...phx.gbl&rnum=6
HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don''t check it very often. You will get a
quicker response by posting to the newsgroup.



Johnd写道:
感谢Bob,但是还有一点细节。

我正在使用Advantage服务器6.2

这里是我的代码:

//设置Conn = Server .CreateObject(" ADODB.Connection")
// Conn.Open" DSN = LocalOP"
// strQuery ="插入NCRheadcomments(hdrcomid,headerid,
comdate,
userid,comments,comtime)" & _
//" values(10084,10080,''"& FormatDateTime(Date(),VBshortDate
)& _ //"'',''"& ; session(" CurrentUser")&"'',''"&
CurrentComment&"'',''"&
time&"'' )"
//设置objRS = Conn.Execute(strQuery)


为什么要创建一个记录集对象来运行非记录返回

查询?就这样做:

Conn.Execute strQuery ,, 129

// conn.close

我的问题是CurrentComment更大超过1024个字符。是否有一种方法可以在不使用已保存的查询的情况下使其工作,因为我不相信我现在可以使用
Thanks Bob but heres a little more detail.

I am using Advantage server 6.2

here is my code:
// Set Conn = Server.CreateObject("ADODB.Connection")
// Conn.Open "DSN=LocalOP"
// strQuery = "insert into NCRheadcomments (hdrcomid, headerid,
comdate,
userid, comments, comtime)" &_
// "values(10084,10080, ''" & FormatDateTime( Date(), VBshortDate
) &_ // "'', ''" & session("CurrentUser") & "'', ''" &
CurrentComment & "'', ''" &
time & "'')"
// Set objRS = Conn.Execute(strQuery)
Why are you creating a recordset object to run a non-records-returning
query? Just do this:
Conn.Execute strQuery,,129

// conn.close
My problem is CurrentComment is larger than 1024 characters. Is
there a way
to get this to work without using a saved query as I do not believe
that is
available to my at this time.




为什么不呢?根据他们的网站,Advantage支持存储过程。


您可能需要使用AppendChunk

http://msdn.microsoft.com/library/en...damth01_3.asp),一个

命令对象和一个Parameter对象。查看该链接中的示例。


对不起,但由于我对Advantage不熟悉,我不打算

be能够详细说明。你有没有试过他们的支持系统?


Bob Barrows

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。我的From

标题中列出的电子邮件帐户是我的垃圾邮件陷阱,因此我不经常检查它。通过发布到新闻组,您将获得更快的回复。



Why not? According to their website, Advantage supports stored procedures.

You will likely need to use AppendChunk
(http://msdn.microsoft.com/library/en...damth01_3.asp), a
Command object and a Parameter object. Check out the example in that link.

I''m sorry but, due to my non-familiarity with Advantage, I am not going to
be able to get into specifics. Have you tried their support system?

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don''t check it very often. You will get a
quicker response by posting to the newsgroup.


这篇关于将参数传递给查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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