PDA

View Full Version : Connecting to the Order table


AsleepATheWheel
11-Dec-2003, 02:39 PM
Hi,

I'm trying to extract some information from the Actinic Order table in Access using an SQL query. I've connected to several other tables with no problems, and even connected to a copy I made of the Order table. However, when I try to connect to the Order table itself I keep getting an error. Unfortunatly I'm not very familiar with Access, is this table locked in some way to stop you connecting with it (it has the cc details in it), or is it another reason? Is it possible to connect with this table:confused:

Thanks for any help,

Regards

Paul

Jan
11-Dec-2003, 04:07 PM
order is a reserved word in SQL so you have to alias the order table as something like orders to use it in SQL.

Regards,

AsleepATheWheel
11-Dec-2003, 04:34 PM
Doh! Thanks for that, I've been trying to figure that out for most of the day!

Much appreciated,

Paul

AsleepATheWheel
12-Dec-2003, 12:15 AM
Well I've never used an alias before, so I've been trying to find information on it for the past few hours. I cant seem to get it to work, it seems it should be something like this:

SELECT * FROM Order As Orders

or

SELECT * FROM [Order] As Orders

But both of these are throwing up errors.

Could you give me an example?

Cheers,

Paul

Jan
12-Dec-2003, 05:16 AM
SELECT Orders.*
FROM [Order] AS ORDERS;

What are you trying to write SQL in? Eg Access, Crystal Reports, ISQL etc.

Regards,

AsleepATheWheel
12-Dec-2003, 12:16 PM
Hi Jan, thanks for your help, I've managed to sort it out now with your help.

I'm developing using Microsoft Visual Basic .NET. I did a bit of COBOL and Pascal years ago, but am very new to sql, vb.net, Access etc. I'm finding it very usefull, though frustrating at times, I'm on a fair bit of a learning curve at the moment!

Paul

AsleepATheWheel
12-Dec-2003, 12:16 PM
Sorry, double posted!