Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with ALTER TABLE

Posted on 2014-03-02
2
Medium Priority
?
530 Views
Last Modified: 2014-03-02
I have 2 lines of code.  The first line works but the second line causes an error 3293 Syntax error in ALTER TABLE statement.  Can anyone tell me why?

   dbs.Execute "ALTER TABLE tblSlsDocHdrs ALTER COLUMN Debit Currency"
   dbs.Execute "ALTER TABLE tblSlsDocHdrs ALTER COLUMN Debit DROP DEFAULT"

Thanks in advance.
0
Comment
Question by:CRB1609
2 Comments
 
LVL 40

Accepted Solution

by:
als315 earned 2000 total points
ID: 39898302
Access SQL version doesn't allow set/drop such properties as Default value or Validation Rule. Possible DROP commands you can find here:
http://msdn.microsoft.com/en-us/library/office/bb177897(v=office.12).aspx
 You should use tabledefs for these properties:
CurrentDb.TableDefs("tblSlsDocHdrs").Fields("Debit").DefaultValue = ""
0
 

Author Closing Comment

by:CRB1609
ID: 39899380
Perfect!  Thank you very much.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question