Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    2

    Unanswered: MS Access, sql-server and stored procedures

    Hi

    I am trying to make a local MS-Access database that gets some of its data from our central SQL-Server based contact register. The database is supposed to be a "on the road" database and I am trying to use the stored procedures that already are there in the SQL-server database to populate the Access-database with data. The slickest solution would be to just push a button to update the access-database with the data from the sql-server (like Hit the road button)

    How do i connect to the sql-server-database and call the SP to update a local tabel in the database

    best regards
    /Lars-Ivar

  2. #2
    Join Date
    Mar 2004
    Location
    www.scirocco.ca
    Posts
    346

    Re: MS Access, sql-server and stored procedures

    If you are using ADO is to call the Execute method from the Connection object. Here is an example:

    Dim cn as ADODB.connection

    Set cn = new ADODB.connection

    cn.ConnectionString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DataBaseName;Data Source=ServerName"

    cn.Open

    cn.Execute "sp_Test"

    cn.Close

    Set cn = Nothing
    http://www.scirocco.ca/images/banner...occobanner.gif

    Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

    Or try our Ask An Expert service to answer any of your questions!

  3. #3
    Join Date
    Mar 2004
    Posts
    2
    Thanks

    This is just what I was looking for. Now I can move forward... xellent.
    best regards. I also found out that I could create a Pass Through question in Access (but in swedish it was refferred as a "Direct question" and I didn't work that out in other forum topics that I ran into)

    Problem solved

    /Lars-Ivar

Posting Permissions

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