Wrox Programmer Forums
|
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 August 19th, 2003, 04:44 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default DoCmd.TransferDatabase

In Access 2000 does anyone know what "databasetype" I would use in the connection string if I'm trying to connect via Windows NT authentication? "ODBC Database" doesn't seem to work. I keep getting the error message Run-time error '3170' "Could not find installable ISAM".

 
Old August 19th, 2003, 07:57 PM
Authorized User
 
Join Date: Aug 2003
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

poonjabba,

Below is a Database Connection example that I've used with Access 2000:

Code:
  Public Sub CompleteDatabaseExample()
  Dim dbMain as New ADODB.Connection        ' Declaring the Connection
  Dim rsCustomer as New ADODB.Recordset    ' Declaring the Recordset
  Dim SQL as String                    ' Declaring a simple variable

  dbMain.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _    ' Connecting to the Database
                 "Persist Security Info=False;" & _
                "Data Source=C:\WINDOWS\Desktop\training.mdb"

  SQL = "SELECT * FROM Customer"        ' Setting up our SQL Command statement
  rsCustomer.Open SQL, dbMain, adOpenDynamic, adLockOptimistic      ' Opening the Recordset (see Recordset Options)
  Do While Not rsCustomer.EOF            ' Loop until we reach the End-Of-File marker
    MsgBox "The Customer's Name is: " & rsCustomer("Name")    
    MsgBox "The Customer's City is: " & rsCustomer("City")
    rsCustomer("Country") = "United States"
    rsCustomer("Name") = rsCustomer("Name") & " Jr."
    rsCustomer.Update                ' Updating the Records  (see also Recordset (Working With))
    rsCustomer.MoveNext            ' Moving to the next record (necessary to reach the EOF)
  Loop
  rsCustomer.Close                    ' Closing the recordset
  dbMain.Close                        ' Closing the database connection
  End Sub

CarlR






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help regarding DoCmd Pramodhegde Access VBA 1 September 7th, 2007 07:05 AM
using DoCmd.TransferDatabase in VB gsurjit VB How-To 2 May 18th, 2006 10:52 PM
Error when using TransferDatabase DrewMills Access VBA 2 November 14th, 2005 06:09 PM
transferdatabase help clowns119 Access VBA 0 February 19th, 2005 11:57 AM
TransferDatabase Macro jmss66 Access 13 January 21st, 2005 11:22 AM





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