都要用代码实现。
谁有详细的资料呢?
和其他的数据库连接的最好也有
嘻嘻~

解决方案 »

  1.   

    http://www.csdn.net/develop/Read_Article.asp?Id=9285与sql server连接可将文章中的
    AConnection.Open('Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\inetpub\wwwroot\test');
    改为
    AConnection.Open("Provider=SQLOLEDB.1;Persist Security Info=False;User ID=用户名;Password=密码;Initial Catalog=库名;Data Source=服务器ip");
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls, DB, ADODB;type
      TForm1 = class(TForm)
        ADOConnection1: TADOConnection;
        labelededit1: TEdit;
        labelededit2: TEdit;
        Button1: TButton;
        Button2: TButton;
        Label1: TLabel;
        Label2: TLabel;
        Edit1: TEdit;
        Label3: TLabel;
        Edit2: TEdit;
        Label4: TLabel;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    var
    str:string;
    begin
    if (labelededit1.Text<>'') and (labelededit2.Text<>'') then
    begin
    //连接远程服务器:str:='Provider=SQLOLEDB.1'+';'+'Persist Security Info=False'+';'+'User ID='+LabeledEdit1.Text+';'+'Password='+labelededit2.text+';'+'Initial Catalog=数据库名称'+';'+'Data Source=服务器名称';str:='Provider=SQLOLEDB.1'+';'+'Persist Security Info=False'+';'+'User ID='+LabeledEdit1.Text+';'+'Password='+labelededit2.text+';'+'Initial Catalog='+edit2.Text+';'+'Data Source='+EDIT1.Text;ADOConnection1.ConnectionString:=str;ADOConnection1.Open;labelededit2.Text:='';
    Button1.Enabled:=false;end;end;procedure TForm1.Button2Click(Sender: TObject);
    begin
    ADOConnection1.Close;Button1.Enabled:=true;end;end.
    下一篇::
    用ADOConnection连接到具体数据库: procedure Tloginmain.Button1Click(Sender: TObject);varstr:string;beginif (labelededit1.Text<>'') and (labelededit1.Text<>'') thenbegin//连接远程服务器:str:='Provider=SQLOLEDB.1'+';'+'Persist Security Info=False'+';'+'User ID='+LabeledEdit1.Text+';'+'Password='+labelededit2.text+';'+'Initial Catalog=数据库名称'+';'+'Data Source=服务器名称';str:='Provider=SQLOLEDB.1'+';'+'Persist Security Info=False'+';'+'User ID='+LabeledEdit1.Text+';'+'Password='+labelededit2.text+';'+'Initial Catalog=testdase';ADOConnection1.ConnectionString:=str;ADOConnection1.Open;labelededit2.Text:='';end;end;断开数据库:
    procedure Tloginmain.Button2Click(Sender: TObject);beginADOConnection1.Close;Button1.Enabled:=true; end;
    具体连接到数据库的某个表可以用:ADODataSet将ADODataSet的Connection属性设置为:ADOConnection将ADODataSet的CommandType属性设置为:cmdTableif not loginmain.ADODataSet1.Active thenbeginADODataSet1.CommandText:='worker_information';//worker_information为表名ADODataSet1.Open;end; 
      

  3.   

    Provider=SQLOLEDB.1
    Persist Security Info=False
    上面两句是什么意思?
    Provider=SQLOLEDB.1 这句是不是指定SQL的驱动?除了上面你说的那种方法还有其他方法吗?
      

  4.   

    Driver={SQL erver};Description=sqldemo;SERVER=127.0.0.1;UID=LoginID; 
    PWD=Password;DATABASE=Database_Name 
      

  5.   

    AConnection.Open("DRIVER=SQL Server;SERVER=数据库服务器名;DATABASE=数据库名;User Id=用户名;PASSWORD=密码;")
      

  6.   

    更正:
    AConnection.Open("DRIVER={SQL Server};ERVER=数据库服务器名;DATABASE=数据库名;User Id=用户名;PASSWORD=密码;")
      

  7.   


    ADOConnection1.ConnectionString:='Provider=SQLOLEDB.1;Password=;Persist Security Info=True;User ID=sa;Initial Catalog=mAppTemplate;Data Source=RKDB';
    ADOConnection1.Open;
      

  8.   

    如果你装的是8i的话,8i本身带了提供者,Oracle Provider  for ole db:
    Provider=OraOLEDB.Oracle.1;Password=;Persist Security Info=True;User ID=system;Data Source=rkdb
      

  9.   

    整理了以下
    嘻~
    myconn.open('
    Provider=SQLOLEDB.1;
    Persist Security Info=False;
    User ID=sa;
    Initial Catalog=master;
    Data Source=a6mm;
    ');
    或者
    myconn.Open('
    DRIVER=SQL Server;
    SERVER=a6mm;
    DATABASE=master;
    User Id=sa;
    ')