Editing max-char
I have just created a table in my database, using the following code:
ALTER TABLE members ADD banned VARCHER(255)
'
the problem is that I after adding this have found out that 255 letters in the field is just not enough!
Therefore I would like to know if there is a way for me to change this, without downloading the database (which is 35 megs; its an access db).
If there is such a way, I would be able to make it all work.
There is some content in some of the fields, but if they cannot stay, it doesn't matter that much.
If I cannot change it, how can I drop that field then, so that I can create a new one with the same name?
Hope that you can help me out!
cheers
~Casper Bang
secretsofwar.net
mairving posted this at 20:32 — 21st June 2001.
They have: 2,256 posts
Joined: Feb 2001
You really want have any problems altering the data. If you were going from 255 characters down to 40 characters or if you were going from a VARCHAR field to an INT field, you would lose some data because the data in the field that didn't conform to the new standards would be kicked out. In the case of increasing the size you wouldn't have any data that would be kicked out.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
hotcut posted this at 20:34 — 21st June 2001.
They have: 133 posts
Joined: Sep 2000
What I want to do is to increase the size, to maybe say 1000 characters... Is the "INT" field the same as a "memo" field, which can have as much info in it as I want?
If so, that would be the perfect solution!
Do you know the code for changing the limits in that field using an SQL code?
Thank in advance
~Casper Bang
Mark Hensler posted this at 22:32 — 21st June 2001.
He has: 4,048 posts
Joined: Aug 2000
You'll have to go from a VARCHAR to MEMO. 255 is the max that the VARCHAR data type will allow.
The INT data type is for holding integers. I think it has a default of 11 digits.
Mark Hensler
If there is no answer on Google, then there is no question.
hotcut posted this at 07:24 — 22nd June 2001.
They have: 133 posts
Joined: Sep 2000
Yea OK, I see what you mean... but can you tell me HOW I change what type of field it is?
Sure I could download it, open it and change it in access, but since its more than 35 megs it will take some time and bandwidth to do...
Do you know the SQL code for changing the type of field, so that I wont have to download?
Thanks
Casper
Peter J. Boettcher posted this at 12:43 — 22nd June 2001.
They have: 812 posts
Joined: Feb 2000
You can use the following SQL to alter a column type:
ALTER TABLE TableName
ALTER COLUMN ColumnName char(150) Null
Just replace tablename with your table, columnname with your column and the datatype to whatever you want to use. The Null on the end means that nulls are allowed. If you don't want nulls then replace that with Not Null, but you can only use Not Null if there is no existing Null data in that column.
PJ | Are we there yet?
pjboettcher.com
hotcut posted this at 12:47 — 22nd June 2001.
They have: 133 posts
Joined: Sep 2000
Thanks man! Worked A OK!
Now it all works
How do you guys no so much????
Thanks
~Casper
Mark Hensler posted this at 17:07 — 22nd June 2001.
He has: 4,048 posts
Joined: Aug 2000
reading, experience, and asking questions
hotcut posted this at 17:09 — 22nd June 2001.
They have: 133 posts
Joined: Sep 2000
heh, well the asking questions thing is something I can take care of
I am currently creating my own forum (the free bulletin boards have low security) so I might need some help
I will create a new thread when the time comes, so that others might be able to learn something from it as well
~casper
Peter J. Boettcher posted this at 17:13 — 22nd June 2001.
They have: 812 posts
Joined: Feb 2000
I hope you're not using Access as the back end of your forum (unless it's going to be a very quiet forum)
Access was never meant to be used as a web back end, and can be a real pooper with 25 or more simultaneous users.
PJ | Are we there yet?
pjboettcher.com
hotcut posted this at 17:15 — 22nd June 2001.
They have: 133 posts
Joined: Sep 2000
heh, yep I am
The intire game I am running
secretsofwar.net
is base on access I know it sucks, but as it is now its my only option... Getting room on a server for an SQL database is expensive you know...
Also, I am not sure what limitations I have in my coding... I will have to figure that out as well...
My database (for the game) is like 40 megs now, and gettting that sort of room on an SQL server is VERY expensive you know...
mairving posted this at 17:53 — 22nd June 2001.
They have: 2,256 posts
Joined: Feb 2001
There are several open-source SQL databases. The most popular is MYSQL. It doesn't take any money to get it, just some time to install it and learn it.
So you really don't know much about SQL and yet you know how to write a more secure version of a bulletin board. I am not really understanding that, especially using Access to do so. Also for the most part, some of the free bulletin boards can be secured quite well. Security is a concern but for the most part a cracker would have nothing to gain by hacking a forum site, beyond some passwords and email addresses.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
hotcut posted this at 17:57 — 22nd June 2001.
They have: 133 posts
Joined: Sep 2000
naa, I am writing it all in ASP, just using the database to store the information...
The free bulleting boards are easy to crack... when I make it myself I can controll it all better...
Many servers takes money to give the space on the mySQL servers... The site I am running requires a good speed, thats why I pay for the hosting...
I don't know much SQL no, I know what i need The forum is almost done, just need to add some administarting options and some mods...
~Casper
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.