Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Creating Tables in Databases
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

MasterFraud
Starting Member

8 Posts

Posted - 22 March 2001 :  00:07:20  Show Profile
hello

I wondering if anyone could help me with my SQL statement I have -
I was wanting to create table within a Access Database from a SQL statement in a script eg like below

SQL1 = "CREATE TABLE SomeTable"
SQL1 = SQL1 &"(Id autoincrement PRIMARY KEY,"
SQL1 = SQL1 &"Script_Build char(50),"
SQL1 = SQL1 &"Last_Update_Num char(100),"
SQL1 = SQL1 &"Approved ?????????

The thing I need to know is if I want the Approved Column (the line in bold) to be a Yes/No format , what term do I use (eg for the key column I would use PRIMARY KEY)

Does anyone know or could point me to a site
Any help would be great

Adam Ware

Aware@bigpond.net.au

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 22 March 2001 :  06:44:42  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
Try BOOLEAN

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

MasterFraud
Starting Member

8 Posts

Posted - 22 March 2001 :  10:07:04  Show Profile
All I get is an error
"Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition. "

I tryed it with this SQL

SQL2 = "CREATE TABLE Sometable (SomeField BOOLEAN)"

Is that right ?

Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 22 March 2001 :  11:04:39  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
I thought Boolean would work...when I look at how a table is defined in access, it's listed as a YES/NO, so maybe that would work

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 22 March 2001 :  15:01:53  Show Profile
From MS docs, for the Jet 4.0 OLEDB provider, I don't know if this info applies to the older ODBC driver


The following CREATE TABLE statement shows the different synonyms that can be used to create the BOOLEAN data type through the Jet OLE DB provider and ADO.

CREATE TABLE tblUIBooleanDataTypes (
Field1_BIT BIT,
Field2_LOGICAL LOGICAL,
Field3_LOGICAL1 LOGICAL1,
Field4_YESNO YESNO)



======
Doug G
======
Go to Top of Page

MasterFraud
Starting Member

8 Posts

Posted - 23 March 2001 :  01:57:58  Show Profile
Thankyou, Thankyou >>>I could Kiss you ...

It works well. Where abouts did you find the Docs for that Doug ? It is hidden somewhere in Windows?

I think I need a copy of that!

Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 23 March 2001 :  03:35:29  Show Profile
http://msdn.microsoft.com/library/default.asp?URL=/library/techart/acintsql.htm

I'm glad it helped


======
Doug G
======
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.21 seconds. Powered By: Snitz Forums 2000 Version 3.4.07