Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2004, 04:36 PM
Registered User
 
Join Date: Oct 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default using oledb to retrieve data from sql server w A2K

Using Access 2000 and trying to retrieve data from SQL Server using dsn-less connection. This is what I have but it does not work. Thanks for any help.

Sub subtest()
Dim strsql As String
Dim cmd As New ADODB.Command

strsql = "SELECT C1.* INTO Customers FROM [Provider=sqloledb;Data Source='server1';Initial Catalog='db1';Integrated Security=SSPI].customers AS C1;"

With cmd
  .ActiveConnection = CurrentProject.Connection
  .CommandText = strsql
  .CommandType = adCmdText
  .Execute
End With

cmd.Close
Set cmd = Nothing
Debug.Print "done"





Similar Threads
Thread Thread Starter Forum Replies Last Post
Import data from sql server using biztalk server kaushalparik Biztalk 0 July 22nd, 2008 06:16 AM
Not able to retrieve data from SQL Server abhishekkashyap27 C# 2005 1 February 11th, 2008 09:19 AM
Sql Server Password Retrieve itHighway SQL Server 2000 3 February 28th, 2006 09:49 AM
retrieve data from SQL server wih XML Thebravehearth XML 3 October 7th, 2004 02:07 AM
Ado.net performance question (SQL server vs OleDB spamp ADO.NET 1 August 2nd, 2004 10:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.