Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASPµ÷Óô洢¹ý³Ì£ºÓÐÊäÈë²ÎÊýºÍÊä³ö²ÎÊýµÄ´æ´¢¹ý³Ì


¡¡¡¡4. ÓÐÊäÈë²ÎÊýºÍÊä³ö²ÎÊýµÄ´æ´¢¹ý³Ì
¡¡¡¡·µ»ØÖµÆäʵÊÇÒ»ÖÖÌØÊâµÄÊä³ö²ÎÊý¡£ÔÚ´ó¶àÊýÇé¿öÏ£¬ÎÒÃÇÓõ½µÄÊÇͬʱÓÐÊäÈë¼°Êä³ö²ÎÊýµÄ´æ´¢¹ý³Ì£¬±ÈÈçÎÒÃÇÏëÈ¡µÃÓû§ÐÅÏ¢±íÖУ¬Ä³IDÓû§µÄÓû§Ãû£¬Õâʱºò£¬ÓÐÒ»¸öÊäÈë²ÎÊý----Óû§ID£¬ºÍÒ»¸öÊä³ö²ÎÊý----Óû§Ãû¡£ÊµÏÖÕâÒ»¹¦ÄܵĴ洢¹ý³ÌÈçÏ£º
/*SP4*/
CREATE PROCEDURE dbo.getUserName
@UserID int,
@UserName varchar(40) output
as
set nocount on
begin
if @UserID is null return
select @UserName=username
from dbo.[userinfo]
where userid=@UserID
return
end
go
¡¡¡¡µ÷Óøô洢¹ý³ÌµÄASP´úÂëÈçÏ£º
'**µ÷ÓôøÓÐÊäÈëÊä³ö²ÎÊýµÄ´æ´¢¹ý³Ì**
DIM MyComm,UserID,UserName
UserID = 1
Set MyComm = Server.CreateObject("ADODB.Command")
MyComm.ActiveConnection = MyConStr 'MyConStrÊÇÊý¾Ý¿âÁ¬½Ó×Ö´®
MyComm.CommandText = "getUserName" 'Ö¸¶¨´æ´¢¹ý³ÌÃû
MyComm.CommandType = 4 '±íÃ÷ÕâÊÇÒ»¸ö´æ´¢¹ý³Ì
MyComm.Prepared = true 'ÒªÇó½«SQLÃüÁîÏÈÐбàÒë
'ÉùÃ÷²ÎÊý
MyComm.Parameters.append MyComm.CreateParameter("@UserID",3,1,4,UserID)
MyComm.Parameters.append MyComm.CreateParameter("@UserName",200,2,40)
MyComm.Execute
'È¡µÃ³ö²Î
UserName = MyComm(1)
Set MyComm = Nothing
¡¡¡¡ÔÚÒÔÉÏ´úÂëÖУ¬¿ÉÒÔ¿´µ½£¬ÓëÉùÃ÷·µ»ØÖµ²»Í¬£¬ÉùÃ÷ÊäÈë²ÎÊýʱÐèÒª5¸ö²ÎÊý£¬ÉùÃ÷Êä³ö²ÎÊýʱÐèÒª4¸ö²ÎÊý¡£ÉùÃ÷ÊäÈë²ÎÊýʱ5¸ö²ÎÊý·Ö±ðΪ£º²ÎÊýÃû¡¢²ÎÊýÊý¾ÝÀàÐÍ¡¢²ÎÊýÀàÐÍ¡¢Êý¾Ý³¤¶È¡¢²ÎÊýÖµ¡£ÉùÃ÷Êä³ö²ÎÊýʱ£¬Ã»ÓÐ×îºóÒ»¸ö²ÎÊý£º²ÎÊýÖµ¡£
¡¡¡¡ÐèÒªÌØ±ð×¢ÒâµÄÊÇ£ºÔÚÉùÃ÷²ÎÊýʱ£¬Ë³ÐòÒ»¶¨ÒªÓë´æ´¢¹ý³ÌÖж¨ÒåµÄ˳ÐòÏàͬ£¬¶øÇÒ¸÷²ÎÊýµÄÊý¾ÝÀàÐÍ¡¢³¤¶ÈÒ²ÒªÓë´æ´¢¹ý³ÌÖж¨ÒåµÄÏàͬ¡£
¡¡¡¡Èç¹û´æ´¢¹ý³ÌÓжà¸ö²ÎÊý£¬ASP´úÂë»áÏԵ÷±Ëö£¬¿ÉÒÔʹÓÃwithÃüÁî¼ò»¯´úÂ룺
'**µ÷ÓôøÓÐÊäÈëÊä³ö²ÎÊýµÄ´æ´¢¹ý³Ì(¼ò»¯´úÂë)**
DIM MyComm,UserID,UserName
UserID = 1
Set MyComm = Server.CreateObject("ADODB.Command")
with MyComm
¡¡.ActiveConnection = MyConStr 'MyConStrÊÇÊý¾Ý¿âÁ¬½Ó×Ö´®
¡¡.CommandText = "getUserName" 'Ö¸¶¨´æ´¢¹ý³ÌÃû
¡¡.CommandType = 4 '±íÃ÷ÕâÊÇÒ»¸ö´æ´¢¹ý³Ì
¡¡.Prepared = true 'ÒªÇó½«SQLÃüÁîÏÈÐбàÒë
¡¡.Parameters.append .CreateParameter("@UserID",3,1,4,UserID)
¡¡.Parameters.append .CreateParameter("@UserName",200,2,40)
¡¡.Exec


Ïà¹ØÎĵµ£º

ASPÖÐÊ®´ó³£ÓóÌÐò´úÂë.£ºµÚÈý½Ú¡´ÎÒµÄÐĵáµ

ÔÚInterDevÖÐʵÏÖÍøÉϹºÎïÍÆ³µ(1)
  
¡¡±¾ÎĽ«½éÉÜÔÚInterDevÖÐʵÏÖÍøÉÏÉ̵깺Îï³µ¹¦Äܵķ½·¨£¬¾ßÌå²½ÖèÈçÏ£º
¡¡¡¡Ò»¡¢ Êý¾Ý¿â½á¹¹£º
¡¡¡¡²úÆ·Êý¾Ý±í(Products): ´æ·Å²úÆ·ÐÅÏ¢
²úÆ·Ãû  ProductName
²úÆ·±àºÅ ProductID
µ¥¼Û Price
·ÖÀà±àºÅ CategoryID
¡¡¡¡ Cart£º¹ºÎï³µÊý¾Ý±í£¬ÁÙʱ´æ·Å¿Í»§µÄ¶ ......

ASPÖÐÊ®´ó³£ÓóÌÐò´úÂë.£ºµÚʮһ½Ú¡´ÎÒµÄÐĵáµ

ASPÍòÓ÷ÖÒ³³ÌÐò
  
¡¡¡¡ÕâÖ»ÊǸöaspС¼¼ÇÉÀàµÄ¶«Î÷£¬ËüËäÈ»ÊʺÏÔÚÿ¸ö²»Í¬ÎļþÃûÀïµ÷ÓÃÕâ¸öº¯Êý£¬µ«ÊÇÒ²ÊÇÓÐǰÌáµÄ£¬ÏÂÃæÈÃÎÒÃÇÀ´×Ðϸ¿´¿´ÆäÖеÄԭί¡£
¡¡¡¡ÏÂÃæÕâ¶ÎÊÇ»ù±¾µÄ·ÖÒ³´úÂ룺
£¼% sql = "select……………………Ê¡ÂÔÁËsqlÓï¾ä
¡¡Set rs=Server ......

ASPÁ¬½Ó´øÃÜÂëµÄACCESSÊý¾Ý¿â ´úÂë¸ñʽ

Ò»:
1 ÃÜÂëÊÇÊý¾Ý¿âÃÜÂ룺
ÉèÖÃÊý¾Ý¿âÃÜÂ룬´ò¿ªÃÜÂëΪ555´ò¿ªÊ±ÐèҪʹÓÃ
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\1.mdb;User ID=admin;Password=;Jet OLEDB:Database Password=555"
2 Óû§×飺
Óû§ÃûΪ admin ÃÜÂëΪ rr Óû§×éÎļþΪ c:\system.mdw£¬´ò¿ªÊ±ÐèҪʹÓÃ
"Provider=Microsoft.Jet.OLEDB.4.0 ......

[ת]asp:UpdatePanelÖÐFileUpload¿Ø¼þÓ¦ÓÃÎÊÌâ

ÔÚasp:UpdatePanel¿Ø¼þÖÐÖ±½ÓʹÓÃFileUpload£¬·þÎñ¶ËÊÇÎÞ·¨ÕÒµ½ÉÏ´«ÎļþµÄ¡£
Ö»ÒªÔÚ<Trigger>ÖÐÌí¼Óbutton¾Í¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
            <ContentTemplate> ......

ASPµ÷Óô洢¹ý³Ì£ºÖ»·µ»Øµ¥Ò»¼Ç¼¼¯µÄ´æ´¢¹ý³Ì


¡¡¡¡1. Ö»·µ»Øµ¥Ò»¼Ç¼¼¯µÄ´æ´¢¹ý³Ì
¡¡¡¡¼ÙÉèÓÐÒÔÏ´洢¹ý³Ì(±¾ÎĵÄÄ¿µÄ²»ÔÚÓÚ½²ÊöT-SQLÓï·¨£¬ËùÒÔ´æ´¢¹ý³ÌÖ»¸ø³ö´úÂ룬²»×÷˵Ã÷)£º
/*SP1*/
CREATE PROCEDURE dbo.getUserList
as
set nocount on
begin
select * from dbo.[userinfo]
end
go
¡¡¡¡ÒÔÉÏ´æ´¢¹ý³ÌÈ¡µÃuserinfo±íÖеÄËùÓмǼ£¬·µ»ØÒ»¸ö¼Ç¼¼¯¡£Í¨¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ