Ask a Question related to Coldfusion Database Access, Design and Development.
-
PlayfulDragon&Phoenix #1
Creating A New Table In Existing Access Database
Hi,
I am trying to create a new table in an existing database and having some
issues. When I use the attached code, it gives me an:
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft
Access Driver] Syntax error in field definition.
and says the error is in line three <cfquery name="test"
datasource="DSNjikuhchagi">
I thought that maybe I should try a <cfinsert> but that seems to demand an
already existing tablename.
Any help for a newbie?
Thanks in advance....
<cfquery name="test" datasource="existingAccessDB"> create table student_list
( s_ID autonumber unique primary key, s_FName text, s_LName text, s_Bday
date, s_Address text, s_City text, s_State text, s_Zip text, s_HPhone
text, s_CPhone text, s_Email text, s_Rank text, s_LastTest date,
s_AddlInfo memo ); </cfquery>
PlayfulDragon&Phoenix Guest
-
Insert table - ASP and access database
Hi, I am working towards trying to insert data in to two tables from one form. My code won't work so I have simplified everything. I... -
Problem with accessing table in access database
i had a working site with iis5 winxp professional on a p4 machine. suddenly i am having problems with and the asp pages which have some updating... -
Merging Excel Info into existing Access Database Query
Help! I have tons of info loaded into an excel spreadsheet that I need to transfer into an existing database in access. There is a specific Query... -
Creating new table with same structure as existing one
I need to create "archive" table that will have the same structure as "production" one. When I run my program it have to create table named... -
HOW TO - Import all Access tables into an existing SQL Database
Andrew, In Queary analyzer, paste the following: SELECT 'TRUNCATE TABLE ' + + char(13) +char(10) +'GO' FROM sysobjects WHERE xtype='U' run... -
mxstu #2
Re: Creating A New Table In Existing Access Database
There are at least two problems that I can see:
- I think autonumber should be changed to counter
- You need to define the size of your "text" fields: someColumn text(50)
mxstu Guest
-
Dan Bracuk #3
Re: Creating A New Table In Existing Access Database
Not sure if this is the case in Access, but in addition to what mxstu said, you
might have to declare your primary key field as not null.
Originally posted by: mxstu
There are at least two problems that I can see:
- I think autonumber should be changed to counter
- You need to define the size of your "text" fields: someColumn text(50)
Dan Bracuk Guest
-
paross1 #4
Re: Creating A New Table In Existing Access Database
Maybe this might work better. You need the CONSTRAINT keyword. Also, since
primary keys are unique (and not null), by definition, it would be redundant to
include the UNIQUE constraint.
<cfquery name="test" datasource="existingAccessDB">
create table student_list
(
s_ID counter CONSTRAINT student_list_pk PRIMARY KEY,
s_FName text,
s_LName text,
s_Bday date,
s_Address text,
s_City text,
s_State text,
s_Zip text,
s_HPhone text,
s_CPhone text,
s_Email text,
s_Rank text,
s_LastTest date,
s_AddlInfo memo
);
</cfquery>
Phil
paross1 Guest
-
PlayfulDragon&Phoenix #5
Re: Creating A New Table In Existing Access Database
Thanks Phil (and everyone else) for your help. That worked great. I hope I'll be able to return the favor some how, some day.
Ben
PlayfulDragon&Phoenix Guest
-
mxstu #6
Re: Creating A New Table In Existing Access Database
>Your text fields will default to 255 characters unless you specify a size
Access lets you define a varchar column without a size? That is just awful. Why am I not suprised ;-)
mxstu Guest



Reply With Quote

