Results 1 to 2 of 2

Thread: Need Help!!

  1. #1
    Join Date
    Jan 2005

    Unanswered: Need Help!!

    I have established a system DSN Data source named 'work' connect to local SQL Server 2000 and the connection test was sucessful.

    I also have written the VB 6.0 code below to connect local Microsoft Access:
    dim dbLocal as ADODB.Connection
    set dbLocal = New ADODB.Connection dbLocal.Open "Provider='Microsoft.Jet.OLEDB.4.0';data source='C:\localdb\data\localdb.mdb'"

    I have some store procedures. some of them accessed the local Microsoft Access tables, some of them accessed both local Microsoft Access tables and local SQL Server tables.

    When I tried to execute the store procedures only accessed tthe local Access tables, they passed.
    When I tried to execute the store procedures that linked to SQL Server tables, the error is:
    ODBC--connection to work failed.

    What should I do?

  2. #2
    Join Date
    Jan 2004

    Stored Procedures

    You need to use the SQLOLEDB.1 provider....

    conn.connectionstring = "Provider=SQLOLEDB.1;Initial Catalog ="MYDB;Data source=(local);Integrated Security=True"

    Then conn.execute("sp_mysp")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts