Creating Tables in Access Using SQL

Results 1 to 2 of 2

Thread: Creating Tables in Access Using SQL

  1. #1
    Join Date
    Dec 1969

    Default Creating Tables in Access Using SQL

    This is a problem I have been struggling with for quite a while now and if anyone could help I would be very grateful<BR><BR>Basically I&#039;m trying to create a table in Access using a sql statement which should be simple enough<BR><BR>Example statement:<BR>Create Table QueryList(QueryID counter PRIMARY KEY NOT NULL,DBpath text (255) NULL,QueryString memo NULL,ResultTemplate text (50) NULL,MaxRecords Long NULL,Random YesNo NULL,DescriptiveName Memo NULL)<BR><BR>If I then retrieve the schema for the database it all looks fine, the correct fields are set to null, the datatypes are correct etc, however if I go into access then the "Allow Zero Length" property is not set to "yes" and I cannot enter nulls into the database. Is there any way to set this from sql or any work around that can be done from code (VB or ASP)?<BR><BR>Any help very much appreciated

  2. #2
    Join Date
    Dec 1969

    Default RE: Creating Tables in Access Using SQL

    I think the Allow Zero length is &#039;special&#039; to Access, so you could uss ADOX to create the new table using the code:<BR><BR>colTemp.Attributes = adColNullable<BR> <BR>See full example:<BR><BR><BR>And the 4Guys simple sample:<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts