我开始项目之前的asp问题 [英] asp questions before i begin project

查看:56
本文介绍了我开始项目之前的asp问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好为客户建立一个网站,并有一些问题

与最佳实践相关,我应该使用的等等...


该网站将使用数据库存储用户输入的信息。每次访问将

允许用户输入不超过2个字段:电子邮件地址和评论

字段。该网站有可能变得非常繁忙所以我的第一个问题

是,我应该在后端使用什么?一个专用的SQL服务器不是一个选项

所以我正在查看Access数据库,或者在Web服务器上安装SQL的桌面版




第二个问题(这可能有助于决定使用哪个DB):什么是

打开数据库的正确方法,以便可以在
进行多次写入如果超过1个用户同时在

输入信息,同时
?我指的是LockType,CursorType等...(我不完全确定

这些东西的运作方式,所以如果有人能给我一个快速的意见,

并指出我在正确的方向,我可以从那里拿走它)


提前谢谢

解决方案



Jimmy写道:


大家好。为客户建立一个网站,并有一些问题

与最佳实践相关,我应该使用的等等...


该网站将使用数据库存储用户输入的信息。每次访问将

允许用户输入不超过2个字段:电子邮件地址和评论

字段。该网站有可能变得非常繁忙所以我的第一个问题

是,我应该在后端使用什么?一个专用的SQL服务器不是一个选项

所以我正在查看Access数据库,或者在Web服务器上安装SQL的桌面版




第二个问题(这可能有助于决定使用哪个DB):什么是

打开数据库的正确方法,以便可以在
进行多次写入如果超过1个用户同时在

输入信息,同时
?我指的是LockType,CursorType等...(我不完全确定

这些东西的运作方式,所以如果有人能给我一个快速的意见,

并指出我在正确的方向,我可以从那里拿走它)


提前谢谢



运行的SQL Server 2005 Express Edition访问Web服务器更好

- 特别是如果有很多Write操作。


访问数据库的最佳方式,无论是Access还是SQL Server是

来创建存储过程(在Access中保存的查询)。从提交的表单中获取输入

,验证它然后将值作为

参数传递给proc。


Pseudo代码:


==存储过程==


创建过程procInsertComments

@EmailAddress nvarchar(50),

@Comments ntext

AS

BEGIN

设定NOCOUNT ON / b
INSERT INTO table(EmailAddress,Comments)VALUES

@EmailAddress,

@Comments

GO




Mike Brind写道:


Jimmy写道:


大家好。为客户建立一个网站,并有一些问题

与最佳实践相关,我应该使用的等等...


该网站将使用数据库存储用户输入的信息。每次访问将

允许用户输入不超过2个字段:电子邮件地址和评论

字段。该网站有可能变得非常繁忙所以我的第一个问题

是,我应该在后端使用什么?一个专用的SQL服务器不是一个选项

所以我正在查看Access数据库,或者在Web服务器上安装SQL的桌面版




第二个问题(这可能有助于决定使用哪个DB):什么是

打开数据库的正确方法,以便可以在
进行多次写入如果超过1个用户同时在

输入信息,同时
?我指的是LockType,CursorType等...(我不完全确定

这些东西的运作方式,所以如果有人能给我一个快速的意见,

并指出我在正确的方向,我可以从那里拿走它)


提前谢谢



运行的SQL Server 2005 Express Edition访问Web服务器更好

- 特别是如果有很多Write操作。


访问数据库的最佳方式,无论是Access还是SQL Server是

来创建存储过程(在Access中保存的查询)。从提交的表单中获取输入

,验证它然后将值作为

参数传递给proc。


Pseudo代码:


==存储过程==


创建过程procInsertComments

@EmailAddress nvarchar(50),

@Comments ntext

AS

BEGIN

设定NOCOUNT ON / b
INSERT INTO table(EmailAddress,Comments)VALUES

@EmailAddress,

@Comments

GO



该死的 - 点击了错误的按钮....忽略上面的错误代码


伪代码:


==存储过程==

创建过程procInsertComments

@EmailAddress nvarchar(50),

@Comments ntext

AS

BEGIN

设置NOCOUNT ON

INSERT INTO table(EmailAddress,Comments)VALUES

@EmailAddress,

@Comments

结束

GO


然后,当你有vali约定表格值,打开数据库

连接,执行插入并立即关闭,例如:


EmailAddress =经过验证的表格价格

评论=经过验证的表格价格


strCon =连接字符串

con.open strCon

con.procInsertComments EmailAddress,Comments

con.Close:设置con = Nothing


-

Mike Brind


Mike Brind写道:


INSERT INTO table(EmailAddress,Comments)VALUES

@EmailAddress,

@Comments



我知道这是空气代码,但值列表应该括号

INSERT INTO table( EmailAddress,Comments)VALUES(

@EmailAddress,

@Comments)


-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。我的From

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


hi everyone. building a website for a client and have a few questions
related to best practices, what i should use etc...

the site will use a database to store info entered by users. each visit will
allow the user to input no more than 2 fields: email address, and a comment
field. the site has the potential to become pretty busy so my first question
is, what should i use on the backend? a dedicated SQL server isnt an option
so im looking at either an Access database, or the desktop edition of SQL
installed on the web server.

second question (and this might help decide which DB to use) is: what are
the proper ways to open the databse so that multiple writes can be done at
the same time in the case where more than 1 user are entering info at the
same time? im referring to LockType, CursorType etc... (im not entirely sure
of the workings of these things so if someone could give me a quick opinion,
and point me in the right direction i can take it from there)

thank you in advance

解决方案


Jimmy wrote:

hi everyone. building a website for a client and have a few questions
related to best practices, what i should use etc...

the site will use a database to store info entered by users. each visit will
allow the user to input no more than 2 fields: email address, and a comment
field. the site has the potential to become pretty busy so my first question
is, what should i use on the backend? a dedicated SQL server isnt an option
so im looking at either an Access database, or the desktop edition of SQL
installed on the web server.

second question (and this might help decide which DB to use) is: what are
the proper ways to open the databse so that multiple writes can be done at
the same time in the case where more than 1 user are entering info at the
same time? im referring to LockType, CursorType etc... (im not entirely sure
of the workings of these things so if someone could give me a quick opinion,
and point me in the right direction i can take it from there)

thank you in advance

SQL Server 2005 Express Edition running on the web server is preferable
to Access - especially if there are a lot of Write operations.

The best way to wirte to the database, whether Access or SQL Server is
to create a stored procedure (saved query in Access). Take the input
from the submitted form, validate it and then pass the values as
parameters to the proc.

Pseudo code:

==Stored Proc==

Create Procedure procInsertComments
@EmailAddress nvarchar(50),
@Comments ntext
AS
BEGIN
SET NOCOUNT ON
INSERT INTO table (EmailAddress,Comments) VALUES
@EmailAddress,
@Comments
GO



Mike Brind wrote:

Jimmy wrote:

hi everyone. building a website for a client and have a few questions
related to best practices, what i should use etc...

the site will use a database to store info entered by users. each visit will
allow the user to input no more than 2 fields: email address, and a comment
field. the site has the potential to become pretty busy so my first question
is, what should i use on the backend? a dedicated SQL server isnt an option
so im looking at either an Access database, or the desktop edition of SQL
installed on the web server.

second question (and this might help decide which DB to use) is: what are
the proper ways to open the databse so that multiple writes can be done at
the same time in the case where more than 1 user are entering info at the
same time? im referring to LockType, CursorType etc... (im not entirely sure
of the workings of these things so if someone could give me a quick opinion,
and point me in the right direction i can take it from there)

thank you in advance


SQL Server 2005 Express Edition running on the web server is preferable
to Access - especially if there are a lot of Write operations.

The best way to wirte to the database, whether Access or SQL Server is
to create a stored procedure (saved query in Access). Take the input
from the submitted form, validate it and then pass the values as
parameters to the proc.

Pseudo code:

==Stored Proc==

Create Procedure procInsertComments
@EmailAddress nvarchar(50),
@Comments ntext
AS
BEGIN
SET NOCOUNT ON
INSERT INTO table (EmailAddress,Comments) VALUES
@EmailAddress,
@Comments
GO

Damn - clicked wrong button.... Disregard erroneous code above

Pseudo code:

==Stored Proc==
Create Procedure procInsertComments
@EmailAddress nvarchar(50),
@Comments ntext
AS
BEGIN
SET NOCOUNT ON
INSERT INTO table (EmailAddress,Comments) VALUES
@EmailAddress,
@Comments
END
GO

Then, when you have validated the form values, open the databse
connection, perform the insert and close immediately eg:

EmailAddress = validated form value
Comments = validated form value

strCon = connection string
con.open strCon
con.procInsertComments EmailAddress, Comments
con.Close : Set con = Nothing

--
Mike Brind


Mike Brind wrote:

INSERT INTO table (EmailAddress,Comments) VALUES
@EmailAddress,
@Comments

I know this is air code, but the list of values should be parenthesized
INSERT INTO table (EmailAddress,Comments) VALUES (
@EmailAddress,
@Comments)

--
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.


这篇关于我开始项目之前的asp问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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