ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

asp ¤º select ¥Î ÅܼÆ

asp ¤º select ¥Î ÅܼÆ

¦b asp .net ¥Î access ¸ê®Æ¸ê, ¦ýselcet ¦æ¤£¤F,
ÅÜ¼Æ sqlstr = "select * from [aa] where [item] = "bb"

   <asp:AccessDataSource ID="AccessDataSource1" runat="server"
        DataFile="~/access/style_list.mdb"
      
        SelectCommand=   & sqlstr & >
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownList1" Name="Cust_code"
                PropertyName="SelectedValue" Type="String" />
            <asp:ControlParameter ControlID="DropDownList3" Name="Desc"
                PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¦^´_ 1# sammyc


    ¦b.net¤¸¥ó¼ÐÅÒ¤º¬O¤£¯à¨Ï¥ÎÅܼƪº
½Ð©óµ{¦¡½X¤º°ÊºA«ü©w
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¥»©«³Ì«á¥Ñ sammyc ©ó 2012-5-28 11:01 ½s¿è

¤v±Nµ{¦¡©ñ¤J µ{¦¡¤º, ¨S¦³¥X¿ù, ¦ý°µ¤£¤F¬d¸Ú®ÄªG ,
sqlstr = "select * from [aa] where [item] = "bb"
accessdatasource1.SelectCommand=   & sqlstr &
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¤v±Nµ{¦¡©ñ¤J µ{¦¡¤º, ¨S¦³¥X¿ù, ¦ý°µ¤£¤F¬d¸Ú®ÄªG ,
sqlstr = "select * from [aa] where  = "bb"
acce ...
sammyc µoªí©ó 2012-5-28 11:00

¸Õ¸Õ¬Ý sqlstr = "select * from [aa] where  = 'bb' "

TOP

¦^´_ 4# c_c_lai
  1.     sqlstr = "select * from [aa] where [item] ='" & bb & "'"
  2. accessdatasource1.SelectCommand=sqlstr
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¦^´_ 5# ¤p»x
§Aªº»yªk´y­z¦a¥¿½T¡A³\¤[¨S¥ÎSQL»yªk¤]¤£³º¥Í²¨¤F¡AÁÂÁ¡I

TOP

¤v¸Õ¹L, ¦bµ{¦¡¤º, ·í BUTTON «ö¤F«á, °£¤FÅV¥Ü²{®Éªº¬d¸Ú»y¥y,¨S¦³¥ô¦ó¤ÏÀ³,
  Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim sqlstr As String
        sqlstr = "SELECT * FROM [Style Module] WHERE ([Cust_code] = '" & t_code & "')"
        TextBox3.Text = sqlstr
                     AccessDataSource1.SelectCommand = sqlstr
End Sub
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 7# sammyc
§A¥u«ü©w¤FAccessDataSourceªºSQL«ü¥O¥h¨ú¸ê®Æ
¨Ã¨S¦³«ü©w¥ô¦ó¸ê®Æ¤¸¥ó(¨Ò¦pGridView)¶i¦æ¸ê®Æôµ²¨ÓÅã¥Ü©Î§ó·s¸ê®Æ£«

AccessDataSource ±±¨î¶µ¯à°÷Åý±z±q Microsoft Access ¸ê®Æ®w (.mdb ÀÉ) Â^¨ú¸ê®Æ¡AµM«á´N¯à°÷¦b¸ê®Æôµ²±±¨î¶µ (¨Ò¦p GridView¡BFormView ©M DetailsView ±±¨î¶µ) ¤¤Åã¥Ü¸ê®Æ¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¦^´_ 7# sammyc
sqlstr = "SELECT * FROM [Style Module] WHERE ([Cust_code] = '" & t_code & "')"
½Ð°Ý§A³o¨àªº [Style Module]«üªº¬O¬Æ»ò¡H¸ê®Æ®wªí³æ¦WºÙ¶Ü¡H [Cust_code]  «üªº¤S¬O¬Æ»ò¡H ªí³æÄæ¦ì¦WºÙ¶Ü¡H
¦pªG¬O¬°¦ó¤S¥[¤W [ ]¡H ¸Õ¸Õ¤U­±ªº¼gªk¡G
sqlstr = "SELECT * FROM StyleModule WHERE Cust_code = '" & t_code & "'"  ¦pªG¬O JSP ¥¦ªº¼gªk·|¬O¡G
sqlstr = "SELECT * FROM StyleModule WHERE Cust_code = '" + t_code + "'" ¸Õ¸Õ¬Ý§a¡I

TOP

[Style Module]¬Oªí³æ¦WºÙ
¦p¤£¥[¤W [ ]·|¥X²{¥H¤U¿ù»~

Microsoft Jet ¸ê®Æ®w¤ÞÀºµLªk§ä¨ì¿é¤J¸ê®Æªí©Î¬d¸ß 'StyleModule'¡C½Ð½T©w¥¦¬O¦s¦bªº¦Ó¥B¦WºÙ¨S¦³«÷¿ù¡C
´y­z: ¦b°õ¦æ¥Ø«e Web ­n¨Dªº¹Lµ{¤¤µo¥Í¥¼³B²zªº¨Ò¥~±¡§Î¡C½ÐÀ˾\°ïÅ|°lÂÜ¥H¨ú±o¿ù»~ªº¸Ô²Ó¸ê°T¡A¥H¤Î¦bµ{¦¡½X¤¤²£¥Íªº¦ì¸m¡C

¨Ò¥~¸Ô²Ó¸ê°T: System.Data.OleDb.OleDbException: Microsoft Jet ¸ê®Æ®w¤ÞÀºµLªk§ä¨ì¿é¤J¸ê®Æªí©Î¬d¸ß 'StyleModule'¡C½Ð½T©w¥¦¬O¦s¦bªº¦Ó¥B¦WºÙ¨S¦³«÷¿ù¡C

­ì©lµ{¦¡¿ù»~:

¦b°õ¦æ¥Ø«e Web ­n¨D´Á¶¡¡A²£¥Í¥¼³B²zªº¨Ò¥~ª¬ªp¡C¦p»Ý¦³Ãö¨Ò¥~ª¬ªp¨Ó·½»P¦ì¸mªº¸ê°T¡A¥i¥H¨Ï¥Î¤U¦Cªº¨Ò¥~ª¬ªp°ïÅ|°lÂܨú±o¡C
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¬°¦Û¤v§äÂǤfªº¤H¥Ã»·¤£·|¶i¨B¡C
ªð¦^¦Cªí ¤W¤@¥DÃD