Simple clear advice in plain English

Hands on: GUID and bad

When uniqueness isn’t quite all it’s cut out to be

Solving the problem
There are (at least) two possible answers to John’s problem. He could write an Append query to add the rows to the new table. If he wanted to move just a subset of them, he could also use a query that identifies the rows making up the subset he wishes to append. If all the required records were for departments to do with furniture and/or furnishings, he could use an append query such as thi s:

INSERT INTO DeptsCopy ( DeptID, DeptName )

SELECT Depts.DeptID, Depts.DeptName

FROM Depts

WHERE ((Depts.DeptName) Like “*furn*”) OR ((Depts.DeptName) Like “furn*”);

The DeptsCopy table shows the result once the query has been run. If you’ve bought the DVD edition of PCW you’ll find the sample database DBCOct07.MDB on the cover disc. It’s also on our website. Here you’ll see that the Append query has not been run so the DeptsCopy table is empty.

John could also copy the data and structure of the original table at the same time and then delete the rows he didn’t want. Again, this would be easiest if only a few rows need to be deleted, or if the relevant records could be identified readily with a query – a Delete query.

Alternatively, John could change the field type from Autonumber/Replication ID to Number/Replication ID and create a structure-only copy of the table. Copying rows now transfers the GUIDs perfectly, but the Number/Replication ID setting cannot be changed back to the Autonumber/Replication ID, so the structure of the original table is lost.

Upsizing Access to SQL Server
It’s the same old story. You develop an Access database for a firm that swears it will never need more than three concurrent users, or to store more than 50,000 records. Three years later, it’s running like a dog for 20 concurrent users accessing two million records and it’s all your fault. Oh, and the database has become mission critical to the firm and runs 24/7. Guess who is to blame if any data is ever lost?

I love Access, but these new requirements fall outside its capabilities, so the best solution is to upsize the entire database to an engine that can support many users, has full logging capabilities and allows online backups. SQL Server is the obvious candidate: you can upsize the tables to the new engine while leaving the application as an Access database. You can continue to use the same user interface, but with a more robust database engine.

You can perform this upsizing by hand, but I strongly advise looking at some of the tools available. One, SSMA (SQL Server Migration Assistant), is free for download from Microsoft’s site.

The first version of SSMA was very buggy. Given that both Access and SQL Server belong to Microsoft, it was so bad as to be embarrassing. The Access query builder uses double quotes to delimit text, as in:

SELECT Customer.CustomerID, Customer.CustomerName

FROM Customer

WHERE Customer.CustomerName)=”Sally”;

Reader Comments

Access is a little out-of-order

I like working whith Access, but it makes working with GUID a real nightmare.... There's no way to do comparisons without strings involved and writing parameter querys is hell if you need to use GUID as criteria. Conclusion: USE SQL and VB.Net

Posted by Catalin-Gabriel Popa, 28 Sep 2007

   

Add your comment

All fields must be completed. Your email address will not be displayed or used to send marketing messages.

All messages will be checked by moderators before appearing on the site.

See our Privacy Policy for more information.

Related articles

Microsoft Excel screenshot

Get to grips with Microsoft Excel

Excel is a worthy program but it takes time to work out what to do with all those cells and columns. We list 12 top tips to help you get the most out of it

Strato home screen

Get started with Strato WebStarter

Sponsored article: Strato's WebStarter offers plenty of templates to give you the type of website that best suits you. Follow our step-by-step guide to using this useful tool

Edit Windows' right-click menus

How to add to and customise the right-click menus in Windows

If you right-click your mouse, a menu of extra options pops up. If you want to add extra choices to this, then Filerfrog makes it easy to customise your Windows list

Question & Answer

Q.Why are some of the keys on my keyboard doing strange...

> Read the answer

Q.Is my phone’s Bluetooth any use?

> Read the answer

Q.Can I switch boot drives so that I can work on older...

> Read the answer

Best deals on the web

img

Samsung RV520-A07

£359.98- Buy it now

img

Acer Aspire 5750G (LX.RXP02.019)

£399.99- Buy it now

img

Apple MacBook Pro (MD313B/A)

£904.37- Buy it now

Latest issue & subscription deals

Poll

Are you concerned about viruses that target mobile phones?

Jargon Buster

Computing terms explained in plain English

Virtual drive

A set of files seen by Windows as a separate hard disk.

Great shopping deals from Computeractive