Alter table - out of resource or locking cells

gaj104

Well-known Member
Joined
Nov 9, 2002
Messages
864
Hi

I have a table with about 45,000 rows, which is created from a direct query.

Unfortunately some of the fields are text rather than numerical. Therefore I run a set of alter queries.

However the way I'm running them makes the system debug due to insufficient resources or maximum locking.

I'm using the following process.

Code:
Dim db As Database
Set db = Access.CurrentDb

thedate = InputBox("What Date would you like to run the CRF for? (DD/MM/YYYY)", "Run CRF On Date")

db.Execute "DROP TABLE CRF"
db.Execute "SELECT * INTO ---hidden for confidentiality--  WHERE (((crf_finance_table.LOAD_DATE)=#" & Format(thedate, "MM/DD/YYYY") & "#));"


'convert CRF to numbers

'where macro crashes!!
db.Execute "ALTER TABLE CRF ALTER COLUMN DESC1 LONG"
db.Execute "ALTER TABLE CRF ALTER COLUMN CUSTOMER_NO LONG"

Any sugesstions how to get around this problem?

Thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Maybe worth a go -- treat the one with the text fields as a temp table.
I have found sometimes that appending to another table with the correct data types will fix it on the fly (eg, Excel data in the wrong format, pulled into Access).

Not always, but often enough to give it a go...

Denis
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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