Source language: Translate to:

ALTER TABLE vs dbpAddField

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

ALTER TABLE vs dbpAddField

Postby BurninBrainCells » Fri Jun 27, 2008 12:44 pm

Hi To All
I have created a db with dbpCreateAccessDatabase, can see the data ok but can't get

ALTER TABLE MainTbl ADD COLUMN ZipCode String(10);
to work

dbpAddField "Accountsdb" "MainTbl" "ZipCode" "String(10)"
works great.

This is the first time I am using dbPro and SQL so I recking I leaving something out. Seems to be connected ok.

Did't find "ALTER TABLE" in the forum search.

Any hints would be great.... BBC
User avatar
BurninBrainCells
 
Posts: 13
Joined: Tue Apr 05, 2005 3:03 am
Location: Ireland

Postby Gaev » Fri Jun 27, 2008 2:52 pm

BBC:

Try ...
Code: Select all
ALTER TABLE MainTbl ADD COLUMN ZipCode Text(10);
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Thanks I Got It

Postby BurninBrainCells » Fri Jun 27, 2008 7:09 pm

Gaev
Thanks you, but why string didn't work and text did.
BBC
User avatar
BurninBrainCells
 
Posts: 13
Joined: Tue Apr 05, 2005 3:03 am
Location: Ireland

Postby Gaev » Sat Jun 28, 2008 5:31 am

BBC:
... but why string didn't work and text did.

Because SQL stands for Structured Query language and NOT Standardized Query Language.

MicroSoft's Access Database Engine calls them Text fields ... mySQL has Text or Char or VarChar fields to store textual data ... don't know what MS SQL or Oracle or DB2 call their fields that store textual data.

If you use NeoBook's (standardized) command set, it takes care of such nuances ... if you skip over such commands (i.e. use dbpExecSQL), your SQL command is passed over to the relevant database engine "as is" ... so you have to speak the exact lingo of that particular database engine.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Im Finding Out Why

Postby BurninBrainCells » Sun Jun 29, 2008 8:36 pm

Hey
I had quite a bit of hassle getting the db to work, I my have mixed-and match commands and plugin vers.
I used your AccessDBU to create the mdb then I added a few fields in NB, then I went back to AccessDBU and added a few more fields etc.
Im gonna start all over tomorrow.
I think i will use only AccessDBU for creation.
Thanks again... BBC
User avatar
BurninBrainCells
 
Posts: 13
Joined: Tue Apr 05, 2005 3:03 am
Location: Ireland


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 3 guests