Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2003, 04:44 PM
Registered User
 
Join Date: Aug 2003
Location: , , .
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".

Reply With Quote
  #2 (permalink)  
Old August 19th, 2003, 07:57 PM
Authorized User
 
Join Date: Aug 2003
Location: Penn Yan, New York, USA.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 08:25 PM.


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