|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Newbie: can't ALTER TABLE from asp page...
Hello,
I'm new to SQL 2000 and had a client give me just the username/password for the database, and the .asp files that are used to access it. They want me to add a couple of columns but when I had the .asp file send the following command to the server it responded with the error listed below. var Command1 = Server.CreateObject("ADODB.Command"); Command1.ActiveConnection = MM_TESTCONN_STRING; Command1.CommandText = "ALTER TABLE `REGISTRATION` ADD `EDUCATIONGPA1` WCHAR(50);"; Command1.CommandType = 4; Command1.CommandTimeout = 0; Command1.Prepared = true; Command1.Execute(); The response was: The Microsoft Jet database engine cannot find the input table or query 'ALTER' I successfully used this connection to query before so, does this mean some permissions have been set to not allow a user to ALTER from an .asp file? I am new to db's as a whole and have always used some form of front-end for the mySQL work I've done in the past, but without access to the server and the application that allows me to do this, how else can I add a few columns to this DB? any help is greatly appreciated, and if anyone is interrested in some random hourly project work for little things like this, throw your email on your response. thanks in advance, Brian |
|
#2
|
||||
|
||||
|
Yeah, it could be that the login they gave you doesn't have adequate permissions. However, the syntax of the statement is also incorrect. It should read something like this:
"ALTER TABLE REGISTRATION ADD EDUCATIONGPA1 CHAR(50)" However, this brings up more questions here. 1. Why do you want to alter a table from an ASP page? Why not use the Query Analyser tool or the Enterprise manager to do this. 2. It is considered bad practice to use such a powerful account as one that alters table structures on an ASP page anyway. If someone manages to read the source code somehow, they have the password to a powerful account that could be used to drop tables as easily as creating columns.
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
Thanks,
I was trying to keep from needing to buy SQL Server for my desktop since I mostly develop in *NIX environments... but they have an evaluation version that I am downloading. That should make things easier for me now. thanks again Brian |
|
#4
|
||||
|
||||
|
From your post
Quote:
it seems you are using Access and not SQLServer, so I don't think that EnterpriseManager or QueryAnalyzer will help. Also, those tools are available separately from the server engine, so no need to install the server on your pc
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#5
|
|||
|
|||
|
H, im in the same boat kinda.. i need a create a new column each time a user hits submit witha new column name, but im at a loss as to hwo to do it! ive already got the code working to update a column with the date that a page was read, but no i have to allow somone else to create the columns (id usualy manually do it)
heres a rough idea as to what im going on about: PHP Code:
do i setthe form action the a subroutine - and wrap the SQL script in that subroutine? ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Newbie: can't ALTER TABLE from asp page... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|