Reserved error -3025

Kevlarhead

Board Regular
Joined
May 23, 2006
Messages
176
I've got a database which imports 2 text files into temp tables, appends them to a single large table, and then drops the temp tables. That bit works perfectly.

I'm now trying to add some form of logging to this. My idea was to make a logging table, and call a query which would capture the user's name, file being added, date, time and the number of rows being imported. To avoid doing anything fancy, I decided I'd make one query for each file, so the filenames are hardcoded into the query. I made an insert query, which I thought was fairly straightforward, and found it failed each time reporting the ever-so-helpful 'Reserved error -3025'.

I've now changed the INSERT into a SELECT purely for test purposes and it's still giving me the same error.

My query for making up most of the log details works fine:
SELECT 'File1' AS Filename, Environ('Username') As User_ID, Now() AS Import_DateTime

My query for getting the count of the rows in the temp table works too.
SELECT COUNT(Part_No) FROM tbl_TempFile1 AS Record_Count

But when I put the two together i get the Reserved error
SELECT 'File1' AS Filename, (SELECT Count(Part_No) FROM tbl_TempFile1) AS Record_Count, Environ('Username') AS User_ID, Now() AS Import_DateTime

I can't see what I'm doing wrong here. Can anyone suggest what I need to do to make this work?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,864
Messages
6,121,984
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top