当能可以,ADOConnection1.CONNECTIONSTRING属性的...号按照步骤就可以啦

解决方案 »

  1.   

    当然可以了,首先在datamodule中放入adoconnection控键,再设它的连接,在connectionstring中设,然后当你要使用表时,需放入adoquery和datasource控键,具体连接,自己看帮助吧
      

  2.   

    '************************
    '***假设要连接的数据库名称为myDSN,用户名sa
    '************************asp中:
    dim conn,rs,strConn,strSql
    set conn = server.createobject("ADODB.Connection")
    set rs = server.createobject("ADODB.Recordset")
    strConn = "DSN=myDSN; UID=sa; PWD="
    conn.ConnectionString = strConn
    conn.open
    strSql = "select * from table"
    set rs = conn.execute(strSql)VB中:
    Adodc1.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=dbname;Data Source=servername"
    Adodc1.RecordSource = "SELECT * from table"
    Adodc1.Refresh
      

  3.   

    adoQuery1.ConnectionString := '
    Provider=SQLOLEDB.1;
    Password=mypassword;
    Persist Security Info=True;
    User ID=sa;
    Initial Catalog=MyDB;
    Data Source=MyServer;
    Use Procedure for Prepare=1;
    Auto Translate=True;
    Packet Size=4096;
    Use Encryption for Data=False;
    Tag with column collation when possible=False
    '