连接语句如何写

解决方案 »

  1.   

    Syntax with a DSN or FileDSN:
    "[Provider=MSDASQL;] { DSN=name | FileDSN=filename } ; 
    [DATABASE=database;] UID=user; PWD=password"Syntax without a DSN (DSN-less connection):
    "[Provider=MSDASQL;] DRIVER=driver; SERVER=server; 
    DATABASE=database; UID=user; PWD=password"
      

  2.   

    语法我当然知道,关键是
    "Provider=SQLOLEDB;
    驱动程序名称是什么
      

  3.   

    If the user does not provide a value for Default Schema, then the ODBC driver uses the USER_ID provided at login. The Microsoft ODBC Driver for DB2, which is implemented as an IBM DRDA Application Requester, uses packages to issue dynamic and static SQL statements. The ODBC driver will create packages dynamically in the location to which the user points using the Package Collection parameter. recordset.Open "EXEC OPEN LIBRARY/FILE","Provider=SNAOLEDB;Data Source=REMLU;User ID=USERNAME;Password=password;Local LU=LOCAL;Remote LU=DATABASE;ModeName=QPCSUPP;CCSID=37;CodePage=437", adOpenDynamic, adLockOptimistic, adCmdText
      

  4.   

    请看
    http://www.yesky.com/20020320/1602633.shtml
      

  5.   

    Does IBM DB2 Support OLE-DB and ADO?
    Yes, IBM DB2 supports OLE DB and ADO via the Kajera OLE DB-to-ODBC mapping. IBM does not currently have a native OLE DB provider, but plans to provide one in the future.IBM DB/2 ODBC Driver IBM's DB/2 ODBC Driver supports Microsoft Transaction Server. 
    You can obtain information about IBM's DB2 ODBC driver from IBM's Web site at http://www.software.ibm.com/data/db2/db2tech/db2mts.htm
      

  6.   

    老大,我在MSDN里面找了很久,不过我的水平也菜,就只能找到这些了
    你看看“DB2OLEDB”行不行吧
    帮你UP一下好了
      

  7.   

    OLE DB Provider for DB2 
      
    oConn.Open = "Provider=DB2OLEDB;" & 
               "Network Transport Library=TCPIP;" & 
               "Network Address=MyServer;" & _
               "Package Collection=MyPackage;" & 
               "Host CCSID=1142"
               "Initial Catalog=MyDB;" & 
               "User ID=MyUsername;" & _
               "Password=MyPassword;"For more information, see: OLE DB Provider for DB2 
    and INF: Configuring Data Sources for the Microsoft OLE DB Provider for DB2 
    OLE DB Provider for Index Server 
      
    oConn.Open "Provider=msidxs;" & _
              "Data source=MyCatalog;"
      For more information, see: Microsoft OLE DB Provider for Microsoft Indexing Service