Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and altering table

Status
Not open for further replies.

SQLReaver

Programmer
May 20, 2000
7
0
0
US
I'm using .asp files to execute sql statements to modify a MS Access database.&nbsp;&nbsp;I tried some very simple statements only to find that somehow I can't execute them.<br>The statements are as follows:<br><br>strSQL=&quot;ALTER TABLE ADD Column_Name smallint DEFAULT 0&quot;<br><br>For some reason I can't set the default; if I remove that part it works sometimes!&nbsp;&nbsp;That's the really interesting part - after I tried the statement a couple of times, it might or might not work ( it never works with the default 0 inside ).&nbsp;&nbsp;Can someone help me with this?
 
Just a wild guess...<br>strSQL=&quot;ALTER TABLE ADD Column_Name smallint NOT NULL DEFAULT 0&quot;<br>or NULL as preferred.<br>It should have a default that it will pick up if the null state is not specified, but... <p>Malcolm Wynden<br><a href=mailto:wynden@island.dot.net>wynden@island.dot.net</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top