1

I'm trying to create a table in ms-access at runtime when using VB6. I keep getting an error saying that there is a syntax error in the field definition, but I can't see one anywhere.

"CREATE TABLE PickedByPicco(OrderID INT, StockCode TEXT(30), Qty CURRENCY, ScannedBy TEXT, " & _
                "ProcessedBy TEXT, processed BOOLEAN, Constraint compKey PRIMARY KEY(OrderID, StockCode))"

Where is the error in this query? Is it something to do with the primary key perhaps?

1 Answer 1

1

The name for a boolean yes/no field in Access is BIT, not BOOLEAN.

Use the following:

"CREATE TABLE PickedByPicco(OrderID INT, StockCode TEXT(30), Qty CURRENCY, ScannedBy TEXT, " & _
                "ProcessedBy TEXT, processed BIT, Constraint compKey PRIMARY KEY(OrderID, StockCode))"
Sign up to request clarification or add additional context in comments.

2 Comments

Damn, beat me to it!
Synonyms are BIT, LOGICAL, LOGICAL1, and YESNO.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.