Increasing Data Field Length

G

Guest

Is there a way to increase a data feild length using code?

I have an application that has a front end application and back end
database. I would like to add a button on a form that allows a user to
increase the length of the corresponding data field.

Thanks in advance!

Dwight
 
G

Guest

The table is linked from another MDB. Can this all be done by using a button
on a form from the front end application? The back end database is locked to
user

Thanks!

Dwight
 
G

Guest

Thanks Allen!

I am getting closer, but when I execute this code I get the following error:

***************
Private Sub UpdateFieldPosition_Click()

Dim dbs As Database
Dim strSQL As String

Set dbs = OpenDatabase("C:\ResumeBuilder2.0\ResumeBuilder_data.mde")
strSQL = "ALTER TABLE Header ALTER COLUMN Position TEXT(100);"
dbs.Execute strSQL, dbFailOnError
Set dbs = Nothing

End Sub
******************

ERROR:
The database engine could not lock the table 'Header' because it is already
in use by another user or process.

Your assistance would be greatly appreciated.

Dwight
 
A

aaron.kempf

Dwight
you should just set this to a reasonable number at development time

I really reccomend using Access Data Projects instead of this MDB
crap.. you can always change objects on the db server, unlike this MDB
crap that gives u random 'file in use' errors


hth

-Aaron
 
A

Allen Browne

Okay: so the locking error indicates that the table is already in use.

Perhaps something (form? report? query? combo?) is using data from this
table at the time when you are attempting to run this code?
 
I

i_takeuti

Dwight said:
Thanks Allen!

I am getting closer, but when I execute this code I get the following
error:

***************
Private Sub UpdateFieldPosition_Click()

Dim dbs As Database
Dim strSQL As String

Set dbs = OpenDatabase("C:\ResumeBuilder2.0\ResumeBuilder_data.mde")
strSQL = "ALTER TABLE Header ALTER COLUMN Position TEXT(100);"
dbs.Execute strSQL, dbFailOnError
Set dbs = Nothing

End Sub
******************

ERROR:
The database engine could not lock the table 'Header' because it is
already
in use by another user or process.

Your assistance would be greatly appreciated.

Dwight
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top