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 | Calendar | 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 September 28th, 2004, 11:10 AM
Registered User
 
Join Date: Sep 2004
Location: Istanbul, , Turkey.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to peace
Default Unique Record Identifier

Hi,
I'm linking tables with DoCmd.TransferDatabase command from an SQL DB, but for some tables "select unique record identifier" dialog appears. I know that's because primary key for that tables are not defined. Is there a way to bypass this dialog with code? Otherwise user will have to click cancel for 5-6 times each time she runs the program.
Reply With Quote
  #2 (permalink)  
Old December 6th, 2005, 12:03 PM
Registered User
 
Join Date: Dec 2005
Location: Oxford, , United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi there,

There's a good full example of this at: http://tinyurl.com/9l55d (look for Brenda's post near the end) but as the example is very lengthy, the basic steps are as follows:

- Delete the old linekd table with deleteobject if necessary
- Create a new tabledef with createtabledef
- Set the .connect and .sourcetable properties of this tabledef
- append it to the TableDefs collection
- refresh the tabledefs collection (tabledefs.refresh)
- if you need more than read access to the tables, then you need to specify in code the unique record identifier. You can do this with a docmd.runsql sending a "CREATE UNIQUE INDEX" command to the DB. See Brenda's example on the link above.

Hope that helps - let me know,

Al
http://www.integritec.co.uk

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
passing unique record from form to form Baconant Beginning VB 6 1 January 2nd, 2008 06:20 PM
Insert Record Fails W/ Unique Constraint snw C# 0 September 2nd, 2005 02:14 PM
Counting unique record dlamarche Access 5 March 22nd, 2005 08:51 AM
Identifier Expected syncmaster VB.NET 2002/2003 Basics 1 September 2nd, 2004 03:34 AM
Updating Unique Identifier foreign key to NULL jraymond VB Databases Basics 0 June 16th, 2003 01:51 PM



All times are GMT -4. The time now is 06:39 PM.


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