UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Removing The 'required'/not Null Restriction Using Vba, Office 2003    
 
   
ddaddy
post Sep 14 2011, 06:26 AM
Post #1

UtterAccess Addict
Posts: 293



Hi, I am trying to use the ALTER TABLE, ALTER COLUMN command in vba to set required=no of an existing table but can't figure out how to do it.

Here is the code I currently have. What needs to go inplace of ....?

Thanks

CODE
Dim cnn As New ADODB.Connection
    LinkPathFile = Mid(FindSource(), 11)

    With cnn
        .Open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & LinkPathFile
        .Execute "ALTER TABLE tblRequests ALTER COLUMN RequestFee ....."
        .Close
    End With
Go to the top of the page
 
+
 
Start new topic
Replies
vtd
post Sep 14 2011, 11:51 AM
Post #2

Retired Moderator
Posts: 19,667



Sorry... I was thinking of T-SQL.

I normally use DAO Field Object to alter the Required Property of the JET Table Field istead of ADO + JET DDL.

An alternative is to use ADOX. See UA Topic Code Library Form with lst/cbo RowSource pointing to FE and follow the links to the 2 MSDN articles posted by Brent for more info.

Go to the top of the page
 
+

Posts in this topic


Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 23rd May 2013 - 04:04 AM