»ª·áÈí¼þ

»¥ÁªÍøÈí¼þ×ÊÔ´¹²Ïí

µ±Ç°Î»ÖãºÊ×Ò³ -> ×ÛºÏƵµÀ -> Õ¾³¤Ö®¼Ò

vbÈçºÎÁ¬½ÓÉÏÔ¶³ÌSQLÊý¾Ý¿â

¹«¹²Ä£¿é£º
Private Function Selectsql(SQL As String) As ADODB.Recordset '·µ»ØADODB.Recordset¶ÔÏó
Dim ConnStr As String
Dim Conn As ADODB.Connection
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Set Conn = New ADODB.Connection

'On Error GoTo MyErr:
ConnStr = "Provider=SQLOLEDB.1;Persist Security Info=True;User ID=µÇ¼Êý¾Ý¿âÓû§Ãû(ĬÈÏΪsa);Password=µÇ¼Êý¾Ý¿âÃÜÂë;Initial Catalog=Êý¾Ý¿âÃû;Data Source=·þÎñÆ÷Ãû(IPµØÖ·)" 'ÕâÊÇÁ¬½ÓSQLÊý¾Ý¿âµÄÓï¾ä
Conn.Open ConnStr
rs.CursorLocation = adUseClient
rs.Open Trim$(SQL), Conn, adOpenDynamic, adLockOptimistic
End Function

µ÷Óãº
SQL = "SELECT * FROM Óû§±í WHERE Óû§Ãû='" & Combo1.Text & "' AND ÃÜÂë='" & Text1.Text & "' "
Set rs = Selectsql(SQL)


ÉÏһƪ£ºVBÔ¶³ÌÁ¬½Ósqlserver ·þÎñÆ÷¶ËÅä..
ÏÂһƪ£ºsqlÔ¶³ÌÁ¬½ÓSQL£¨²»ÄÜ´ò¿ªµ½Ö÷»ú..

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

ËÑË÷
×îÐÂÎÄÕÂ
ͼƬÖ÷Ìâ
ÈÈÃÅÎÄÕÂ
ÍƼöÎÄÕÂ
Ïà¹ØÎÄÕÂ

    Ê× Ò³   |   °æȨÉùÃ÷   |   ¹ØÓÚÎÒÃÇ   |   ¹ã¸æ·þÎñ   |   ÁªÏµÎÒÃÇ   |   ÊÖ»ú°æ    |   ÍøÕ¾µØͼ
    Copyright@zhuchunyu.com all rights reserved
    Powered by zhuchunyu.com 2018-2025 zhuchunyu.com ÍîICP±¸05011767ºÅ-23